mirror of
https://github.com/friendica/friendica
synced 2024-11-14 03:42:53 +00:00
Remove scripts/dbstructure
- Updated documentation
This commit is contained in:
parent
4622f42b1d
commit
132456697c
4 changed files with 75 additions and 142 deletions
|
@ -213,8 +213,8 @@ The listed emails need to be separated by a comma.
|
||||||
Please have a look at the Admin panel under [DB updates](/admin/dbsync/) and follow the link to *check database structure*.
|
Please have a look at the Admin panel under [DB updates](/admin/dbsync/) and follow the link to *check database structure*.
|
||||||
This will start a background process to check if the structure is up to the current definition.
|
This will start a background process to check if the structure is up to the current definition.
|
||||||
|
|
||||||
You can manually execute the structure update from the CLI in the base directory of your Friendica installation by running the following script:
|
You can manually execute the structure update from the CLI in the base directory of your Friendica installation by running the following command:
|
||||||
|
|
||||||
scripts/dbstructure.php update
|
bin/console dbstructure update
|
||||||
|
|
||||||
if there occur any errors, please contact the [support forum](https://forum.friendi.ca/profile/helpers).
|
if there occur any errors, please contact the [support forum](https://forum.friendi.ca/profile/helpers).
|
||||||
|
|
|
@ -235,8 +235,8 @@ Rufe bitte im Admin Panel den Punkt [DB Updates](/admin/dbsync/) auf und folge d
|
||||||
Damit wird ein Hintergrundprozess gestartet der die Struktur deiner Datenbank überprüft und gegebenenfalls aktualisiert.
|
Damit wird ein Hintergrundprozess gestartet der die Struktur deiner Datenbank überprüft und gegebenenfalls aktualisiert.
|
||||||
|
|
||||||
Du kannst das Struktur Updatee auch manuell auf der Kommandoeingabe ausführen.
|
Du kannst das Struktur Updatee auch manuell auf der Kommandoeingabe ausführen.
|
||||||
Starte dazu bitte vom Grundverzeichnis deiner Friendica Instanz folgendes Skript:
|
Starte dazu bitte vom Grundverzeichnis deiner Friendica Instanz folgendes Kommand:
|
||||||
|
|
||||||
scripts/dbstructure.php update
|
bin/console dbstructure update
|
||||||
|
|
||||||
sollten bei der Ausführung Fehler auftreten, kontaktiere bitte das [Support Forum](https://forum.friendi.ca/profile/helpers).
|
sollten bei der Ausführung Fehler auftreten, kontaktiere bitte das [Support Forum](https://forum.friendi.ca/profile/helpers).
|
||||||
|
|
|
@ -718,7 +718,7 @@ function admin_page_summary(App $a)
|
||||||
$warningtext = [];
|
$warningtext = [];
|
||||||
if (DBM::is_result($r)) {
|
if (DBM::is_result($r)) {
|
||||||
$showwarning = true;
|
$showwarning = true;
|
||||||
$warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php scripts/dbstructure.php toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
|
$warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php bin/console dbstructure toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
|
||||||
}
|
}
|
||||||
// Check if github.com/friendica/master/VERSION is higher then
|
// Check if github.com/friendica/master/VERSION is higher then
|
||||||
// the local version of Friendica. Check is opt-in, source may be master or devel branch
|
// the local version of Friendica. Check is opt-in, source may be master or devel branch
|
||||||
|
@ -735,7 +735,7 @@ function admin_page_summary(App $a)
|
||||||
}
|
}
|
||||||
if (Config::get('system', 'dbupdate') == DB_UPDATE_FAILED) {
|
if (Config::get('system', 'dbupdate') == DB_UPDATE_FAILED) {
|
||||||
$showwarning = true;
|
$showwarning = true;
|
||||||
$warningtext[] = L10n::t('The database update failed. Please run "php scripts/dbstructure.php update" from the command line and have a look at the errors that might appear.');
|
$warningtext[] = L10n::t('The database update failed. Please run "php bin/console dbstructure update" from the command line and have a look at the errors that might appear.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_worker_call = Config::get('system', 'last_poller_execution', false);
|
$last_worker_call = Config::get('system', 'last_poller_execution', false);
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* @file scripts/dbstructure.php
|
|
||||||
* @brief Does database updates from the command line
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\Core\Config;
|
|
||||||
use Friendica\Database\DBStructure;
|
|
||||||
|
|
||||||
require_once "boot.php";
|
|
||||||
require_once "include/dba.php";
|
|
||||||
|
|
||||||
$a = new App(dirname(__DIR__));
|
|
||||||
BaseObject::setApp($a);
|
|
||||||
|
|
||||||
@include ".htconfig.php";
|
|
||||||
dba::connect($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
|
||||||
|
|
||||||
if ($_SERVER["argc"] == 2) {
|
|
||||||
switch ($_SERVER["argv"][1]) {
|
|
||||||
case "dryrun":
|
|
||||||
DBStructure::update(true, false);
|
|
||||||
return;
|
|
||||||
case "update":
|
|
||||||
DBStructure::update(true, true);
|
|
||||||
|
|
||||||
$build = Config::get('system','build');
|
|
||||||
if (!x($build)) {
|
|
||||||
Config::set('system', 'build', DB_UPDATE_VERSION);
|
|
||||||
$build = DB_UPDATE_VERSION;
|
|
||||||
}
|
|
||||||
|
|
||||||
$stored = intval($build);
|
|
||||||
$current = intval(DB_UPDATE_VERSION);
|
|
||||||
|
|
||||||
// run any left update_nnnn functions in update.php
|
|
||||||
for ($x = $stored; $x < $current; $x ++) {
|
|
||||||
$r = run_update_function($x);
|
|
||||||
if (!$r) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Config::set('system','build',DB_UPDATE_VERSION);
|
|
||||||
return;
|
|
||||||
case "dumpsql":
|
|
||||||
DBStructure::printStructure();
|
|
||||||
return;
|
|
||||||
case "toinnodb":
|
|
||||||
DBStructure::convertToInnoDB();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// print help
|
|
||||||
echo $_SERVER["argv"][0]." <command>\n";
|
|
||||||
echo "\n";
|
|
||||||
echo "Commands:\n";
|
|
||||||
echo "dryrun show database update schema queries without running them\n";
|
|
||||||
echo "update update database schema\n";
|
|
||||||
echo "dumpsql dump database schema\n";
|
|
||||||
echo "toinnodb convert all tables from MyISAM to InnoDB\n";
|
|
||||||
killme();
|
|
||||||
|
|
Loading…
Reference in a new issue