| @@ 17-33 (lines=17) @@ | ||
| 14 | */ |
|
| 15 | class BanMuteSupportIssue157 extends AbstractMigration |
|
| 16 | { |
|
| 17 | public function up() |
|
| 18 | { |
|
| 19 | $bansTable = $this->table('bans'); |
|
| 20 | $bansTable |
|
| 21 | ->removeColumn('allow_server_join') |
|
| 22 | ->addColumn('is_soft_ban', 'boolean', [ |
|
| 23 | 'after' => 'author', |
|
| 24 | 'null' => false, |
|
| 25 | 'default' => false, |
|
| 26 | 'comment' => 'A soft ban will not penalize a user on the site or servers', |
|
| 27 | ]) |
|
| 28 | ->update() |
|
| 29 | ; |
|
| 30 | ||
| 31 | // Unban any currently banned players |
|
| 32 | $this->query("UPDATE players SET status = 'active' WHERE status = 'banned';"); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function down() |
|
| 36 | { |
|
| @@ 35-48 (lines=14) @@ | ||
| 32 | $this->query("UPDATE players SET status = 'active' WHERE status = 'banned';"); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function down() |
|
| 36 | { |
|
| 37 | $bansTable = $this->table('bans'); |
|
| 38 | $bansTable |
|
| 39 | ->removeColumn('is_soft_ban') |
|
| 40 | ->addColumn('allow_server_join', 'boolean', [ |
|
| 41 | 'after' => 'reason', |
|
| 42 | 'null' => false, |
|
| 43 | 'default' => false, |
|
| 44 | 'comment' => 'Whether or not to allow players to join servers while banned' |
|
| 45 | ]) |
|
| 46 | ->update() |
|
| 47 | ; |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||