forked from GNUsocial/gnu-social
Add --all option on dumpschema.php to check all core tables
This commit is contained in:
parent
cc69ede1ee
commit
3c979ec506
@ -25,7 +25,7 @@ Attempt to pull a schema definition for a given table.
|
|||||||
|
|
||||||
END_OF_CHECKSCHEMA_HELP;
|
END_OF_CHECKSCHEMA_HELP;
|
||||||
|
|
||||||
$longoptions = array('diff');
|
$longoptions = array('diff', 'all');
|
||||||
require_once INSTALLDIR.'/scripts/commandline.inc';
|
require_once INSTALLDIR.'/scripts/commandline.inc';
|
||||||
|
|
||||||
function indentOptions($indent)
|
function indentOptions($indent)
|
||||||
@ -87,6 +87,13 @@ function getCoreSchema($tableName)
|
|||||||
return $schema[$tableName];
|
return $schema[$tableName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCoreTables()
|
||||||
|
{
|
||||||
|
$schema = array();
|
||||||
|
include INSTALLDIR . '/db/core.php';
|
||||||
|
return array_keys($schema);
|
||||||
|
}
|
||||||
|
|
||||||
function dumpTable($tableName, $live)
|
function dumpTable($tableName, $live)
|
||||||
{
|
{
|
||||||
if ($live) {
|
if ($live) {
|
||||||
@ -117,6 +124,10 @@ function showDiff($a, $b)
|
|||||||
unlink($fnameB);
|
unlink($fnameB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (have_option('all')) {
|
||||||
|
$args = getCoreTables();
|
||||||
|
}
|
||||||
|
|
||||||
if (count($args)) {
|
if (count($args)) {
|
||||||
foreach ($args as $tableName) {
|
foreach ($args as $tableName) {
|
||||||
if (have_option('diff')) {
|
if (have_option('diff')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user