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