mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
46 lines
1.5 KiB
PHP
46 lines
1.5 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateAddressesTable extends Migration
|
|
{
|
|
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('addresses', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->bigInteger('country_id')->unsigned()->nullable();
|
|
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
|
|
$table->bigInteger('company_id')->unsigned()->nullable();
|
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
|
$table->bigInteger('state_id')->unsigned()->nullable();
|
|
$table->foreign('state_id')->references('id')->on('states')->onDelete('cascade');
|
|
$table->bigInteger('district_id')->unsigned()->nullable();
|
|
$table->foreign('district_id')->references('id')->on('districts')->onDelete('cascade');
|
|
$table->string('postcode')->nullable();
|
|
$table->string('street_one')->nullable();
|
|
$table->string('street_two')->nullable();
|
|
$table->integer('billing_type')->nullable();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('addresses');
|
|
}
|
|
}
|