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:
45
tests/dbal/migration/revert.php
Normal file
45
tests/dbal/migration/revert.php
Normal 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)),
|
||||
);
|
||||
}
|
||||
}
|
16
tests/dbal/migration/revert_with_dependency.php
Normal file
16
tests/dbal/migration/revert_with_dependency.php
Normal 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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user