diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-01-10 13:52:11 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-01-10 13:52:11 -0600 |
commit | 00385aa742da17678f7d147b6d71fa759fcd7e78 (patch) | |
tree | 4207b223a6bd464e5ca85a1866ea14edbb50e956 /tests/dbal/migration | |
parent | ddb1eaab6868cfac70b7b202468cab29315b794d (diff) | |
download | forums-00385aa742da17678f7d147b6d71fa759fcd7e78.tar forums-00385aa742da17678f7d147b6d71fa759fcd7e78.tar.gz forums-00385aa742da17678f7d147b6d71fa759fcd7e78.tar.bz2 forums-00385aa742da17678f7d147b6d71fa759fcd7e78.tar.xz forums-00385aa742da17678f7d147b6d71fa759fcd7e78.zip |
[feature/migrations] Basic reverting test
PHPBB3-9737
Diffstat (limited to 'tests/dbal/migration')
-rw-r--r-- | tests/dbal/migration/revert.php | 45 | ||||
-rw-r--r-- | tests/dbal/migration/revert_with_dependency.php | 16 |
2 files changed, 61 insertions, 0 deletions
diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php new file mode 100644 index 0000000000..2bb23e31c2 --- /dev/null +++ b/tests/dbal/migration/revert.php @@ -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)), + ); + } +} diff --git a/tests/dbal/migration/revert_with_dependency.php b/tests/dbal/migration/revert_with_dependency.php new file mode 100644 index 0000000000..f6820dbf3f --- /dev/null +++ b/tests/dbal/migration/revert_with_dependency.php @@ -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'); + } +} |