20220626141033_add_company_bank_details_table.php 988 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class AddCompanyBankDetailsTable extends AbstractMigration {
  5. public function change(): void {
  6. $this->table("company_bank_details", ["signed" => false, "collation" => "utf8mb4_general_ci"])
  7. ->addColumn("company_id", "integer", ["signed" => false])
  8. ->addColumn("currency", "string", ["limit" => 3])
  9. ->addColumn("bank_name", "string", ["null" => true])
  10. ->addColumn("bank_address", "string", ["null" => true])
  11. ->addColumn("bank_sort_code", "string", ["null" => true])
  12. ->addColumn("bank_account_name", "string", ["null" => true])
  13. ->addColumn("bank_account_number", "string", ["null" => true])
  14. ->addColumn("bank_account_iban", "string", ["null" => true])
  15. ->addColumn("dts_created", "datetime")
  16. ->addColumn("dts_updated", "datetime", ["null" => true])
  17. ->addIndex(["company_id", "currency"], ["unique" => true])
  18. ->addForeignKey("company_id", "company", "id")
  19. ->create();
  20. }
  21. }