| 123456789101112131415161718192021 |
- <?php
- use Phinx\Migration\AbstractMigration;
- class AddLocationNoteTable extends AbstractMigration {
- public function change() {
- $fk_options = ["update" => "CASCADE", "delete" => "CASCADE"];
- $this->table("location_note", ["signed" => false])
- ->addColumn("location_id", "integer", ["signed" => false])
- ->addColumn("user_id", "integer", ["signed" => false])
- ->addColumn("content", "text")
- ->addColumn("dts_created", "datetime")
- ->addColumn("dts_updated", "datetime", ["null" => true])
- ->addColumn("dts_deleted", "datetime", ["null" => true])
- ->addForeignKey("location_id", "location", "id", $fk_options)
- ->addForeignKey("user_id", "user", "id", $fk_options)
- ->create();
- }
- }
|