Created
October 11, 2017 16:29
-
-
Save kasimi/00291a408fb175359b6854f312541cf4 to your computer and use it in GitHub Desktop.
phpBB 3.2.1 revert migrations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class m1_initial_schema extends \phpbb\db\migration\migration | |
{ | |
public function update_schema() | |
{ | |
return array( | |
'add_tables' => array( | |
$this->table_prefix . 'test_table' => array( | |
'COLUMNS' => array( | |
'test_id' => array('UINT', null, 'auto_increment'), | |
'some_numbr' => array('UINT', 0), | |
), | |
'PRIMARY_KEY' => 'test_id', | |
), | |
), | |
); | |
} | |
public function revert_schema() | |
{ | |
return array( | |
'drop_tables' => array( | |
$this->table_prefix . 'test_table', | |
), | |
); | |
} | |
} | |
class m2_schema_fix extends \phpbb\db\migration\migration | |
{ | |
public static function depends_on() | |
{ | |
return array( | |
'\kasimi\above\migrations\m1_initial_schema', | |
); | |
} | |
public function update_schema() | |
{ | |
return array( | |
'drop_columns' => array( | |
$this->table_prefix . 'test_table' => array( | |
'some_numbr', | |
), | |
), | |
'add_columns' => array( | |
$this->table_prefix . 'test_table' => array( | |
'some_number' => array('UINT', 0), | |
), | |
), | |
); | |
} | |
public function revert_schema() | |
{ | |
return array( | |
'add_columns' => array( | |
$this->table_prefix . 'test_table' => array( | |
'some_numbr' => array('UINT', 0), | |
), | |
), | |
'drop_columns' => array( | |
$this->table_prefix . 'test_table' => array( | |
'some_number', | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment