| 1 | <?php  | 
            ||
| 6 | class BansStatusColumnConversion extends AbstractMigration  | 
            ||
| 7 | { | 
            ||
| 8 | public function up()  | 
            ||
| 9 |     { | 
            ||
| 10 |         $bansTable = $this->table('bans'); | 
            ||
| 11 | $bansTable  | 
            ||
| 12 |             ->addColumn('is_deleted', 'boolean', [ | 
            ||
| 13 | 'after' => 'is_soft_ban',  | 
            ||
| 14 | 'null' => false,  | 
            ||
| 15 | 'default' => false,  | 
            ||
| 16 | 'comment' => 'Whether or not the ban has been deleted',  | 
            ||
| 17 | ])  | 
            ||
| 18 | ->update()  | 
            ||
| 19 | ;  | 
            ||
| 20 | |||
| 21 |         $this->query("UPDATE bans SET is_deleted = 1 WHERE status = 'deleted';"); | 
            ||
| 22 | |||
| 23 | $bansTable  | 
            ||
| 24 |             ->removeColumn('status') | 
            ||
| 25 | ->update()  | 
            ||
| 26 | ;  | 
            ||
| 27 | }  | 
            ||
| 28 | |||
| 29 | public function down()  | 
            ||
| 50 | }  | 
            ||
| 51 |