1
0

20201125172227_add_location_note_table.php 707 B

123456789101112131415161718192021
  1. <?php
  2. use Phinx\Migration\AbstractMigration;
  3. class AddLocationNoteTable extends AbstractMigration {
  4. public function change() {
  5. $fk_options = ["update" => "CASCADE", "delete" => "CASCADE"];
  6. $this->table("location_note", ["signed" => false])
  7. ->addColumn("location_id", "integer", ["signed" => false])
  8. ->addColumn("user_id", "integer", ["signed" => false])
  9. ->addColumn("content", "text")
  10. ->addColumn("dts_created", "datetime")
  11. ->addColumn("dts_updated", "datetime", ["null" => true])
  12. ->addColumn("dts_deleted", "datetime", ["null" => true])
  13. ->addForeignKey("location_id", "location", "id", $fk_options)
  14. ->addForeignKey("user_id", "user", "id", $fk_options)
  15. ->create();
  16. }
  17. }