mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
47 lines
1.3 KiB
PHP
47 lines
1.3 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->foreignId('company_id')->unsigned();
|
|
$table->foreignId('country_id')->unsigned();
|
|
$table->foreignId('state_id')->unsigned();
|
|
$table->foreignId('district_id')->unsigned();
|
|
$table->string('postcode');
|
|
$table->string('street_one');
|
|
$table->string('street_two')->nullable();
|
|
$table->integer('billing')->default(true);
|
|
$table->softDeletes();
|
|
$table->timestamps();
|
|
|
|
$table->foreign('country_id')->references('id')->on('countries');
|
|
$table->foreign('company_id')->references('id')->on('companies');
|
|
$table->foreign('state_id')->references('id')->on('states');
|
|
$table->foreign('district_id')->references('id')->on('districts');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('addresses');
|
|
}
|
|
}
|