mirror of
https://github.com/friendica/friendica
synced 2025-04-24 07:10:11 +00:00
Drop unused friendica tables
This commit is contained in:
parent
d5a90f384d
commit
6ebd023c4e
3 changed files with 52 additions and 4 deletions
|
@ -48,11 +48,12 @@ class DatabaseStructure extends \Asika\SimpleConsole\Console
|
|||
$help = <<<HELP
|
||||
console dbstructure - Performs database updates
|
||||
Usage
|
||||
bin/console dbstructure <command> [-h|--help|-?] |-f|--force] [-v]
|
||||
bin/console dbstructure <command> [-h|--help|-?] [-e|--execute] |-f|--force] [-o|--override] [-v]
|
||||
|
||||
Commands
|
||||
dryrun Show database update schema queries without running them
|
||||
update Update database schema
|
||||
drop Drop tables that aren't in use anymore
|
||||
dumpsql Dump database schema
|
||||
toinnodb Convert all tables from MyISAM or InnoDB in the Antelope file format to InnoDB in the Barracuda file format
|
||||
initial Set needed initial values in the tables
|
||||
|
@ -61,8 +62,9 @@ Commands
|
|||
Options
|
||||
-h|--help|-? Show help information
|
||||
-v Show more debug information.
|
||||
-e|--execute Execute the dropping.
|
||||
-f|--force Force the update command (Even if the database structure matches)
|
||||
-o|--override Override running or stalling updates
|
||||
-o|--override Override running or stalling updates
|
||||
HELP;
|
||||
return $help;
|
||||
}
|
||||
|
@ -109,6 +111,12 @@ HELP;
|
|||
$override = $this->getOption(['o', 'override'], false);
|
||||
$output = Update::run($basePath, $force, $override,true, false);
|
||||
break;
|
||||
case "drop":
|
||||
$execute = $this->getOption(['e', 'execute'], false);
|
||||
ob_start();
|
||||
DBStructure::dropTables($execute);
|
||||
$output = ob_get_clean();
|
||||
break;
|
||||
case "dumpsql":
|
||||
ob_start();
|
||||
DBStructure::printStructure($basePath);
|
||||
|
@ -133,7 +141,7 @@ HELP;
|
|||
$output = 'Unknown command: ' . $this->getArgument(0);
|
||||
}
|
||||
|
||||
$this->out($output);
|
||||
$this->out(trim($output));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue