File: /var/www/console.fixgini.com/database/migrations/2024_08_23_063950_create_reviews_table.php
<?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('reviews', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->nullable()->constrained()->cascadeOnDelete();
$table->foreignId('gig_id')->nullable()->constrained()->cascadeOnDelete();
$table->string('comment')->nullable();
$table->enum('status', ['active', 'inactive'])->default('active');
$table->string('star_rating')->required();
$table->string('photo_url')->nullable();
$table->string('photo_public_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('reviews');
}
};