mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
47 lines
1.3 KiB
PHP
47 lines
1.3 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->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');
|
|
}
|
|
}
|