mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateDistrictsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('districts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('country_id')->unsigned();
|
|
$table->foreignId('state_id')->unsigned();
|
|
$table->string('name');
|
|
$table->text('postcode');
|
|
$table->integer('status')->default(ApprovalStatus::APPROVED);
|
|
$table->softDeletes();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('country_id')->references('id')->on('countries');
|
|
$table->foreign('state_id')->references('id')->on('states');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('districts');
|
|
}
|
|
}
|