migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Authentication\Models\Restaurant;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('otp_verifications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Restaurant::class)->constrained('restaurants')->cascadeOnDelete();
|
||||
$table->string('phone');
|
||||
$table->string('otp')->nullable();
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('otp_verifications');
|
||||
}
|
||||
};
|
||||
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('reviews', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->foreignId('customer_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('food_item_id')->constrained()->cascadeOnDelete();
|
||||
|
||||
$table->tinyInteger('rating')->unsigned()->default(5);
|
||||
$table->text('comment')->nullable();
|
||||
|
||||
// moderation & visibility
|
||||
$table->boolean('is_approved')->default(false);
|
||||
$table->boolean('is_active')->default(true);
|
||||
|
||||
// future analytics
|
||||
$table->unsignedInteger('likes_count')->default(0);
|
||||
$table->unsignedInteger('reported_count')->default(0);
|
||||
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('reviews');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('review_images', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->foreignId('review_id')->constrained('reviews')->cascadeOnDelete();
|
||||
|
||||
$table->string('image_path');
|
||||
$table->tinyInteger('position')->default(1);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('review_images');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user