![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/clinic.corals.io/database/migrations/ |
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAddressesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('addresses', function (Blueprint $table) { $table->id(); $table->integer('owner_id')->nullable(); $table->string('owner_type')->nullable(); $table->string('address1')->nullable(); $table->string('address2')->nullable(); $table->unsignedBigInteger('country_id')->nullable(); $table->unsignedBigInteger('state_id')->nullable(); $table->unsignedBigInteger('city_id')->nullable(); $table->string('postal_code')->nullable(); $table->timestamps(); $table->foreign('country_id')->on('countries')->references('id')->onDelete('cascade')->onUpdate('cascade'); $table->foreign('state_id')->on('states')->references('id')->onDelete('cascade')->onUpdate('cascade'); $table->foreign('city_id')->on('cities')->references('id')->onDelete('cascade')->onUpdate('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('addresses'); } }