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