42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class CreateAgentsTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('tbl_agents', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->string('name');
|
||
|
$table->string('email')->unique();
|
||
|
$table->string('phone');
|
||
|
$table->string('display_order')->nullable();
|
||
|
$table->string('remarks')->nullable();
|
||
|
$table->enum('status',['active','in_active'])->nullable();
|
||
|
$table->bigInteger('created_by')->unsigned()->index()->nullable();
|
||
|
$table->bigInteger('last_updated_by')->unsigned()->index()->nullable();
|
||
|
$table->foreign('created_by')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
|
||
|
$table->foreign('last_updated_by')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
|
||
|
$table->timestamps();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('agents');
|
||
|
}
|
||
|
}
|