20220626135804_add_company_table.php 844 B

12345678910111213141516171819202122
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class AddCompanyTable extends AbstractMigration {
  5. public function change(): void {
  6. $this->table("company", ["signed" => false, "collation" => "utf8mb4_general_ci"])
  7. ->addColumn("address_id", "integer", ["signed" => false])
  8. ->addColumn("name", "string")
  9. ->addColumn("phone", "string", ["null" => true])
  10. ->addColumn("fax", "string", ["null" => true])
  11. ->addColumn("email", "string", ["null" => true])
  12. ->addColumn("company_number", "string", ["null" => true])
  13. ->addColumn("vat_number", "string", ["null" => true])
  14. ->addColumn("dts_created", "datetime")
  15. ->addColumn("dts_updated", "datetime", ["null" => true])
  16. ->addColumn("dts_deleted", "datetime", ["null" => true])
  17. ->addForeignKey("address_id", "address", "id")
  18. ->create();
  19. }
  20. }