allow to update generic subsets of tables
This commit is contained in:
parent
11a83b2345
commit
73248f7dda
|
@ -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;
|
global $a, $db;
|
||||||
|
|
||||||
$errors = false;
|
$errors = false;
|
||||||
|
@ -130,6 +130,7 @@ function update_structure($verbose, $action) {
|
||||||
// Get the current structure
|
// Get the current structure
|
||||||
$database = array();
|
$database = array();
|
||||||
|
|
||||||
|
if (is_null($tables))
|
||||||
$tables = q("show tables");
|
$tables = q("show tables");
|
||||||
|
|
||||||
foreach ($tables AS $table) {
|
foreach ($tables AS $table) {
|
||||||
|
@ -139,6 +140,7 @@ function update_structure($verbose, $action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the definition
|
// Get the definition
|
||||||
|
if (is_null($definition))
|
||||||
$definition = db_definition();
|
$definition = db_definition();
|
||||||
|
|
||||||
// Compare it
|
// Compare it
|
||||||
|
|
Loading…
Reference in a new issue