aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/db/migration.php5
-rw-r--r--phpBB/includes/db/migrator.php7
-rw-r--r--tests/dbal/migration/dummy.php8
3 files changed, 16 insertions, 4 deletions
diff --git a/phpBB/includes/db/migration.php b/phpBB/includes/db/migration.php
index f96fcb9568..ee916aedc0 100644
--- a/phpBB/includes/db/migration.php
+++ b/phpBB/includes/db/migration.php
@@ -52,12 +52,13 @@ class phpbb_db_migration
}
/**
- * Updates the database schema
+ * Updates the database schema by providing a set of change instructions
*
- * @return null
+ * @return array
*/
function update_schema()
{
+ return array();
}
/**
diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php
index f4613e3aec..4a178af468 100644
--- a/phpBB/includes/db/migrator.php
+++ b/phpBB/includes/db/migrator.php
@@ -151,7 +151,7 @@ class phpbb_db_migrator
if (!$state['migration_schema_done'])
{
- $migration->update_schema();
+ $this->apply_schema_changes($migration->update_schema());
$state['migration_schema_done'] = true;
}
else
@@ -245,4 +245,9 @@ class phpbb_db_migrator
return true;
}
+
+ function apply_schema_changes($schema_changes)
+ {
+ $this->db_tools->perform_schema_changes($schema_changes);
+ }
}
diff --git a/tests/dbal/migration/dummy.php b/tests/dbal/migration/dummy.php
index b286d44f77..0567b50740 100644
--- a/tests/dbal/migration/dummy.php
+++ b/tests/dbal/migration/dummy.php
@@ -16,7 +16,13 @@ class phpbb_dbal_migration_dummy extends phpbb_db_migration
function update_schema()
{
- $this->db_column_add('phpbb_config', 'extra_column', array('UINT', 0));
+ return array(
+ 'add_columns' => array(
+ 'phpbb_config' => array(
+ 'extra_column' => array('UINT', 0),
+ ),
+ ),
+ );
}
function update_data()