Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
phpBB 3.2.1 revert migrations
<?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
You can’t perform that action at this time.