D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
forge
/
shaghela.online
/
database
/
migrations
/
Filename :
2021_06_01_050736_create_booking_ratings_table.php
back
Copy
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateBookingRatingsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('booking_ratings', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('booking_id'); $table->unsignedBigInteger('service_id'); $table->unsignedBigInteger('customer_id'); $table->double('rating')->nullable(); $table->longText('review')->nullable(); $table->foreign('service_id')->references('id')->on('services')->onDelete('cascade'); $table->foreign('booking_id')->references('id')->on('bookings')->onDelete('cascade'); $table->softDeletes(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('booking_ratings'); } }