| @@ 29-49 (lines=21) @@ | ||
| 26 | ; |
|
| 27 | } |
|
| 28 | ||
| 29 | public function down() |
|
| 30 | { |
|
| 31 | $bansTable = $this->table('bans'); |
|
| 32 | $bansTable |
|
| 33 | ->addColumn('status', 'set', [ |
|
| 34 | 'values' => ['public', 'hidden', 'deleted'], |
|
| 35 | 'after' => 'is_soft_ban', |
|
| 36 | 'null' => false, |
|
| 37 | 'default' => 'public', |
|
| 38 | 'comment' => 'The status of the ban element', |
|
| 39 | ]) |
|
| 40 | ->update() |
|
| 41 | ; |
|
| 42 | ||
| 43 | $this->query("UPDATE bans SET status = 'deleted' WHERE is_deleted = true;"); |
|
| 44 | ||
| 45 | $bansTable |
|
| 46 | ->removeColumn('is_deleted') |
|
| 47 | ->update() |
|
| 48 | ; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 40-62 (lines=23) @@ | ||
| 37 | ; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function down() |
|
| 41 | { |
|
| 42 | $newsCategoryTable = $this->table('news_categories'); |
|
| 43 | $newsCategoryTable |
|
| 44 | ->addColumn('status', 'set', [ |
|
| 45 | 'values' => ['enabled', 'disabled', 'deleted'], |
|
| 46 | 'after' => 'is_deleted', |
|
| 47 | 'null' => false, |
|
| 48 | 'default' => 'enabled', |
|
| 49 | 'comment' => 'The status of the news element', |
|
| 50 | ]) |
|
| 51 | ->renameColumn('is_protected', 'protected') |
|
| 52 | ->update() |
|
| 53 | ; |
|
| 54 | ||
| 55 | $this->query("UPDATE news_categories SET status = 'deleted' WHERE is_deleted = 1;"); |
|
| 56 | ||
| 57 | $newsCategoryTable |
|
| 58 | ->removeColumn('is_deleted') |
|
| 59 | ->removeColumn('is_read_only') |
|
| 60 | ->update() |
|
| 61 | ; |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| @@ 35-55 (lines=21) @@ | ||
| 32 | ; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function down() |
|
| 36 | { |
|
| 37 | $mapsTable = $this->table('maps'); |
|
| 38 | $mapsTable |
|
| 39 | ->addColumn('status', 'set', [ |
|
| 40 | 'values' => ['active', 'hidden', 'disabled', 'deleted'], |
|
| 41 | 'null' => false, |
|
| 42 | 'default' => 'active', |
|
| 43 | 'comment' => 'The status of the map', |
|
| 44 | ]) |
|
| 45 | ->update() |
|
| 46 | ; |
|
| 47 | ||
| 48 | $this->query("UPDATE maps SET status = 'hidden' WHERE is_inactive = 1;"); |
|
| 49 | $this->query("UPDATE maps SET status = 'deleted' WHERE is_deleted = 1;"); |
|
| 50 | ||
| 51 | $mapsTable |
|
| 52 | ->removeColumn('is_inactive') |
|
| 53 | ->removeColumn('is_deleted') |
|
| 54 | ; |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| @@ 50-72 (lines=23) @@ | ||
| 47 | ; |
|
| 48 | } |
|
| 49 | ||
| 50 | public function down() |
|
| 51 | { |
|
| 52 | $serversTable = $this->table('servers'); |
|
| 53 | $serversTable |
|
| 54 | ->addColumn('status', 'set', [ |
|
| 55 | 'values' => ['active', 'disabled', 'deleted'], |
|
| 56 | 'null' => false, |
|
| 57 | 'default' => 'active', |
|
| 58 | 'comment' => 'The status of the server relative to BZiON', |
|
| 59 | ]) |
|
| 60 | ->update() |
|
| 61 | ; |
|
| 62 | ||
| 63 | $this->query("UPDATE servers SET status = 'deleted' WHERE is_inactive = 1;"); |
|
| 64 | ||
| 65 | $serversTable |
|
| 66 | ->removeColumn('is_official_server') |
|
| 67 | ->removeColumn('is_replay_server') |
|
| 68 | ->removeColumn('is_inactive') |
|
| 69 | ->removeColumn('is_deleted') |
|
| 70 | ->update() |
|
| 71 | ; |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||