| 12345678910111213141516 |
- <?php
- use Phinx\Migration\AbstractMigration;
- class AddUserLocationRejectTable extends AbstractMigration {
- public function change() {
- $this->table("user_location_reject", ["id" => false, "primary_key" => ["user_id", "location_id"]])
- ->addColumn("user_id", "integer", ["signed" => false])
- ->addColumn("location_id", "integer", ["signed" => false])
- ->addColumn("reject_count", "integer", ["signed" => false, "default" => 0])
- ->addColumn("dts_last_rejected", "datetime")
- ->addForeignKey("user_id", "user", "id", ["update" => "CASCADE", "delete" => "CASCADE"])
- ->addForeignKey("location_id", "user", "id", ["update" => "CASCADE", "delete" => "CASCADE"])
- ->create();
- }
- }
|