migrate to gtea from bistbucket

This commit is contained in:
2026-03-15 17:08:23 +07:00
commit 129ca2260c
3716 changed files with 566316 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('faq_questions', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('question', 255);
$table->longText('answer')->nullable();
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('faq_questions');
}
};

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('policies', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('type')->comment('1=privacy, 2=cookie, 3=terms & conditions');
$table->longText('description');
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('policies');
}
};

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('academic_images', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title')->nullable();
$table->text('heading')->nullable();
$table->longText('description')->nullable();
$table->string('image')->nullable();
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('academic_images');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('about_us', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title', 255)->index();
$table->longText('description')->nullable();
$table->string('image', 255)->nullable();
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('about_us');
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('our_histories', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->year('year');
$table->string('title', 255);
$table->text('descriptions')->nullable();
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('our_histories');
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('banners', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title', 255)->nullable();
$table->text('description')->nullable();
$table->string('button_name', 100)->nullable();
$table->string('button_link', 500)->nullable();
$table->string('button_two_name', 100)->nullable();
$table->string('button_two_link', 500)->nullable();
$table->string('image', 255)->nullable();
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('banners');
}
};

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('testimonials', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('name');
$table->longText('description');
$table->string('thumbnail_image')->nullable();
$table->string('video_url')->nullable();
$table->string('note')->nullable();
$table->integer('ratting')->default(0);
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('testimonials');
}
};

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('frontend_contacts', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('email');
$table->string('name')->nullable();
$table->string('phone')->nullable();
$table->string('subject')->nullable();
$table->text('message')->nullable();
$table->timestamps();
$table->softDeletes();
// Unique per restaurant + email only
$table->unique(['restaurant_id', 'email'], 'restaurant_email_unique');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('frontend_contacts');
}
};

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('pages', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title');
$table->string('slug');
$table->string('type');
$table->text('content')->nullable();
$table->string('meta_data')->nullable();
$table->text('seo_meta_keywords')->nullable();
$table->text('seo_meta_description')->nullable();
$table->string('page_status')->default('draft');
$table->string('page_template')->default('default');
$table->unsignedBigInteger('author_id')->index();
$table->timestamps();
$table->softDeletes();
// Combine unique constraint
$table->unique(['restaurant_id', 'slug'], 'unique_combination');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('pages');
}
};

View File

@@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('onboardings', function (Blueprint $table) {
$table->id();
// 🏢 Restaurant Information
$table->string('restaurant_name');
$table->string('restaurant_email')->nullable();
$table->string('restaurant_phone', 20)->nullable();
$table->string('restaurant_domain');
$table->string('restaurant_type')->nullable();
$table->string('restaurant_address');
$table->string('restaurant_logo')->nullable();
// 👤 Owner / User Information
$table->string('name');
$table->string('email');
$table->string('phone', 20)->nullable();
$table->string('password');
$table->string('avatar')->nullable();
$table->decimal('amount', 10, 2)->default(0);
$table->enum('status', ['pending', 'in_progress', 'documents_submitted', 'approved', 'rejected', 'hold'])->default('pending');
$table->foreignId('approved_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('approved_at')->nullable();
$table->timestamps();
$table->softDeletes();
// ⚡ Indexes
$table->index(['status']);
$table->index(['restaurant_name']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('onboardings');
}
};

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('why_choose_us', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title');
$table->text('description')->nullable();
$table->string('icon')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('why_choose_us');
}
};

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('ready_to_join_us', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title');
$table->text('description')->nullable();
$table->string('icon')->nullable();
$table->string('button_name', 100)->nullable();
$table->string('button_link', 500)->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('ready_to_join_us');
}
};

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('mobile_app_sections', function (Blueprint $table) {
$table->id();
$table->foreignId('restaurant_id')->constrained('restaurants')->cascadeOnDelete();
$table->string('title');
$table->string('heading');
$table->text('description')->nullable();
$table->string('image')->nullable();
$table->string('feature_one')->nullable();
$table->string('feature_two')->nullable();
$table->string('feature_three')->nullable();
$table->string('play_store_link')->nullable();
$table->string('app_store_link')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mobile_app_sections');
}
};

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('themes', function (Blueprint $table) {
$table->id();
$table->string('category'); // Core Academic, Early Childhood, etc.
$table->string('name'); // Elementary, High School, etc.
$table->string('icon')->nullable(); // 🏫, 🎒, etc.
$table->string('description'); // Theme purpose
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('themes');
}
};

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('c_m_s_sections', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('restaurant_id')->nullable();
$table->string('name');
$table->integer('serial')->default(0);
$table->string('title')->nullable();
$table->text('description')->nullable();
$table->string('image')->nullable();
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
$table->timestamps();
$table->softDeletes();
});
}
public function down(): void
{
Schema::dropIfExists('c_m_s_sections');
}
};

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('coupons', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('restaurant_id')->nullable()->comment('Optional restaurant id');
$table->unsignedBigInteger('user_id')->nullable()->comment('User who created this coupon');
$table->string('name', 100)->comment('Coupon name');
$table->string('added_by')->nullable()->comment('Added by admin/system');
$table->enum('discount_type', ['fixed', 'percentage', 'free_delivery'])->default('fixed')->comment('Discount type');
$table->enum('coupon_type', ['restaurant', 'hotel', 'both'])->default('restaurant')->comment('Where this coupon can be used');
$table->decimal('amount', 10, 2)->default(0.00)->comment('Discount amount or percentage');
$table->dateTime('valid_from')->nullable()->comment('Start date/time');
$table->dateTime('valid_to')->nullable()->comment('End date/time');
$table->unsignedInteger('usage_limit')->default(1)->comment('Total usage limit');
$table->unsignedInteger('max_uses_per_customer')->default(1)->comment('Max usage per customer');
$table->decimal('min_order_amount', 10, 2)->nullable()->comment('Minimum order amount to apply coupon');
$table->string('image')->nullable()->comment('Coupon image/banner');
$table->string('source')->default('local')->comment('Local or external');
$table->smallInteger('status')->default(1)->comment('1=Active, 2=Inactive');
$table->timestamps();
$table->softDeletes();
// Indexes for faster queries
$table->index('restaurant_id');
$table->index('user_id');
$table->index(['valid_from', 'valid_to']);
$table->index('status');
});
}
public function down(): void
{
Schema::dropIfExists('coupons');
}
};

View File

@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('coupon_usages', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('restaurant_id')->nullable()->comment('Optional restaurant id');
$table->unsignedBigInteger('coupon_id');
$table->unsignedBigInteger('customer_id')->nullable(); // customer using the coupon
$table->unsignedBigInteger('order_id')->nullable(); // optional link to order
$table->timestamps();
$table->foreign('coupon_id')->references('id')->on('coupons')->onDelete('cascade');
});
}
public function down(): void
{
Schema::dropIfExists('coupon_usages');
}
};