From 73248f7dda6e152c3cdcebde4574583fca8c3556 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Tue, 31 Mar 2015 10:21:29 +0200 Subject: [PATCH] allow to update generic subsets of tables --- include/dbstructure.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/dbstructure.php b/include/dbstructure.php index f131abe64f..bd33858dad 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -120,7 +120,7 @@ function print_structure($database) { } } -function update_structure($verbose, $action) { +function update_structure($verbose, $action, $tables=null, $definition=null) { global $a, $db; $errors = false; @@ -130,7 +130,8 @@ function update_structure($verbose, $action) { // Get the current structure $database = array(); - $tables = q("show tables"); + if (is_null($tables)) + $tables = q("show tables"); foreach ($tables AS $table) { $table = current($table); @@ -139,7 +140,8 @@ function update_structure($verbose, $action) { } // Get the definition - $definition = db_definition(); + if (is_null($definition)) + $definition = db_definition(); // Compare it foreach ($definition AS $name => $structure) {