1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 15:01:33 +02:00

[feature/migrations] Basic reverting test

PHPBB3-9737
This commit is contained in:
Nathan Guse
2013-01-10 13:52:11 -06:00
parent ddb1eaab68
commit 00385aa742
3 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
/**
*
* @package testing
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
class phpbb_dbal_migration_revert extends phpbb_db_migration
{
function depends_on()
{
return array();
}
function update_schema()
{
return array(
'add_columns' => array(
'phpbb_config' => array(
'bar_column' => array('UINT', 1),
),
),
);
}
function revert_schema()
{
return array(
'drop_columns' => array(
'phpbb_config' => array(
'bar_column',
),
),
);
}
function update_data()
{
return array(
array('config.add', array('foobartest', 0)),
);
}
}

View File

@@ -0,0 +1,16 @@
<?php
/**
*
* @package testing
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
class phpbb_dbal_migration_revert_with_dependency extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_dbal_migration_revert');
}
}