| 1234567891011121314151617181920 |
- <?php
- declare(strict_types=1);
- use Phinx\Migration\AbstractMigration;
- final class AddCustomerTable extends AbstractMigration {
- public function change(): void {
- $this->table("customer", ["signed" => false, "collation" => "utf8mb4_general_ci"])
- ->addColumn("address_id", "integer", ["signed" => false, "null" => true])
- ->addColumn("name", "string")
- ->addColumn("phone", "string")
- ->addColumn("fax", "string")
- ->addColumn("email", "string")
- ->addColumn("dts_created", "datetime")
- ->addColumn("dts_updated", "datetime", ["null" => true])
- ->addColumn("dts_deleted", "datetime", ["null" => true])
- ->addForeignKey("address_id", "address", "id", ["update" => "CASCADE", "delete" => "SET NULL"])
- ->create();
- }
- }
|