aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/migration
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-01-09 18:59:15 -0600
committerNathan Guse <nathaniel.guse@gmail.com>2013-01-09 18:59:15 -0600
commit44c10f661ee548ae08fe81ba76f47f1c8134b96f (patch)
tree65857ddf9728db066409bc9b2502ea55e4b5ac4a /phpBB/includes/db/migration
parent595246f9bf17f1bef69c285ba8e78534cd91054a (diff)
downloadforums-44c10f661ee548ae08fe81ba76f47f1c8134b96f.tar
forums-44c10f661ee548ae08fe81ba76f47f1c8134b96f.tar.gz
forums-44c10f661ee548ae08fe81ba76f47f1c8134b96f.tar.bz2
forums-44c10f661ee548ae08fe81ba76f47f1c8134b96f.tar.xz
forums-44c10f661ee548ae08fe81ba76f47f1c8134b96f.zip
[feature/migrations] Creating revert method to attempt reverting a migration
This code is in progress PHPBB3-9737
Diffstat (limited to 'phpBB/includes/db/migration')
-rw-r--r--phpBB/includes/db/migration/migration.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/phpBB/includes/db/migration/migration.php b/phpBB/includes/db/migration/migration.php
index 5f1f0443db..61fbf04320 100644
--- a/phpBB/includes/db/migration/migration.php
+++ b/phpBB/includes/db/migration/migration.php
@@ -94,6 +94,16 @@ abstract class phpbb_db_migration
}
/**
+ * Reverts the database schema by providing a set of change instructions
+ *
+ * @return array Array of schema changes (compatible with db_tools->perform_schema_changes())
+ */
+ public function revert_schema()
+ {
+ return array();
+ }
+
+ /**
* Updates data by returning a list of instructions to be executed
*
* @return array Array of data update instructions
@@ -104,6 +114,19 @@ abstract class phpbb_db_migration
}
/**
+ * Reverts data by returning a list of instructions to be executed
+ *
+ * @return array Array of data instructions that will be performed on revert
+ * NOTE: calls to tools (such as config.add) are automatically reverted when
+ * possible, so you should not attempt to revert those, this is mostly for
+ * otherwise unrevertable calls (custom functions for example)
+ */
+ public function revert_data()
+ {
+ return array();
+ }
+
+ /**
* Wrapper for running queries to generate user feedback on updates
*
* @param string $sql SQL query to run on the database