| 1234567891011121314151617181920212223 |
- <?php
- declare(strict_types=1);
- use Phinx\Migration\AbstractMigration;
- final class AddCompanyBankDetailsTable extends AbstractMigration {
- public function change(): void {
- $this->table("company_bank_details", ["signed" => false, "collation" => "utf8mb4_general_ci"])
- ->addColumn("company_id", "integer", ["signed" => false])
- ->addColumn("currency", "string", ["limit" => 3])
- ->addColumn("bank_name", "string", ["null" => true])
- ->addColumn("bank_address", "string", ["null" => true])
- ->addColumn("bank_sort_code", "string", ["null" => true])
- ->addColumn("bank_account_name", "string", ["null" => true])
- ->addColumn("bank_account_number", "string", ["null" => true])
- ->addColumn("bank_account_iban", "string", ["null" => true])
- ->addColumn("dts_created", "datetime")
- ->addColumn("dts_updated", "datetime", ["null" => true])
- ->addIndex(["company_id", "currency"], ["unique" => true])
- ->addForeignKey("company_id", "company", "id")
- ->create();
- }
- }
|