Files
exchange-2.0/database/migrations/2020_11_24_062534_create_banks_table.php
glovetleong 4adc4a2b36 pull
2021-03-12 15:15:29 +08:00

50 lines
1.5 KiB
PHP

<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BankAccountType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBanksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('banks', function (Blueprint $table) {
$table->id();
$table->foreignId('company_id')->unsigned();
$table->string('reference')->nullable();
$table->string('bank_name');
$table->string('holder_name');
$table->string('account_no');
$table->string('bank_branch')->nullable();
$table->string('swift')->nullable();
$table->string('snap')->nullable();
$table->integer('type')->default(BankAccountType::EXTERNAL);
$table->integer('default')->default(false);
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->foreignId('country_id')->unsigned();
$table->softDeletes();
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries');
$table->foreign('company_id')->references('id')->on('companies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('company_banks');
}
}