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);
/**
* ],
* ],
*
+ * 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",
$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');
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;
/**
* 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. 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()"
*/