Files
exchange-2.0/database/migrations/2014_10_11_100012_create_states_table.php
omair saleh 05401f6bbc large commit
2021-03-11 13:06:40 +08:00

39 lines
913 B
PHP

<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('states', function (Blueprint $table) {
$table->id();
$table->foreignId('country_id')->unsigned();
$table->string('name');
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('states');
}
}