Browse Source

Move DB_UPDATE_VERSION from boot.php to config/dbstructure.php

pull/5981/head
Hypolite Petovan 3 years ago
parent
commit
19ffc0510b
5 changed files with 13 additions and 4 deletions
  1. +0
    -1
      boot.php
  2. +5
    -0
      config/dbstructure.php
  3. +5
    -1
      src/App.php
  4. +2
    -1
      src/Database/DBStructure.php
  5. +1
    -1
      update.php

+ 0
- 1
boot.php View File

@ -41,7 +41,6 @@ define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily');
define('FRIENDICA_VERSION', '2018.12-dev');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('DB_UPDATE_VERSION', 1289);
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/**


+ 5
- 0
config/dbstructure.php View File

@ -27,11 +27,16 @@
* ],
* ],
*
* If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
*
*/
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1289);
}
return [
"addon" => [
"comment" => "registered addons",


+ 5
- 1
src/App.php View File

@ -573,7 +573,11 @@ class App
$stamp1 = microtime(true);
DBA::connect($db_host, $db_user, $db_pass, $db_data, $charset);
if (DBA::connect($db_host, $db_user, $db_pass, $db_data, $charset)) {
// Loads DB_UPDATE_VERSION constant
Database\DBStructure::definition();
}
unset($db_host, $db_user, $db_pass, $db_data, $charset);
$this->saveTimestamp($stamp1, 'network');


+ 2
- 1
src/Database/DBStructure.php View File

@ -5,8 +5,8 @@
namespace Friendica\Database;
use Exception;
use Friendica\Core\Hook;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Util\DateTimeFormat;
@ -830,6 +830,7 @@ class DBStructure
/**
* Loads the database structure definition from the config/dbstructure.php file.
* On first pass, defines DB_UPDATE_VERSION constant.
*
* @see config/dbstructure.php
* @return array


+ 1
- 1
update.php View File

@ -32,7 +32,7 @@ require_once 'include/dba.php';
*
* 1. Create a function "update_4712()" here in the update.php
* 2. Apply the needed structural changes in config/dbStructure.php
* 3. Set DB_UPDATE_VERSION in boot.php to 4712.
* 3. Set DB_UPDATE_VERSION in config/dbstructure.php to 4712.
*
* If you need to run a script before the database update, name the function "pre_update_4712()"
*/


Loading…
Cancel
Save