forked from science-ation/science-ation
Add an option to bypass the actual db version update write to the
database, so for testing the same update can be applied over and over without needing to update the db.
This commit is contained in:
parent
5338adefa9
commit
8d1c6e1cd4
@ -6,7 +6,7 @@ if(!function_exists("system")) {
|
||||
|
||||
//include the config.inc.php
|
||||
//so we have the db connection info
|
||||
require("../data/config.inc.php");
|
||||
require_once('../data/config.inc.php');
|
||||
echo "<pre>\n";
|
||||
if(file_exists("db.code.version.txt")) {
|
||||
$dbcodeversion_file=file("db.code.version.txt");
|
||||
@ -17,6 +17,8 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
$skip_dbversion_update = array_key_exists('skip_dbversion_update', $_GET);
|
||||
|
||||
mysql_connect($DBHOST,$DBUSER,$DBPASS);
|
||||
mysql_select_db($DBNAME);
|
||||
@mysql_query("SET NAMES utf8");
|
||||
@ -98,10 +100,15 @@ if($dbcodeversion && $dbdbversion) {
|
||||
config_update_variables();
|
||||
}
|
||||
|
||||
|
||||
if($skip_dbversion_update) {
|
||||
echo "\nAll done - skip_dbversion_update specified, NOT updating to DB version to $dbcodeversion\n";
|
||||
} else {
|
||||
echo "\nAll done - updating new DB version to $dbcodeversion\n";
|
||||
mysql_query("UPDATE config SET val='$dbcodeversion' WHERE var='DBVERSION' AND conferences_id='0'");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "ERROR: dbcodeversion and dbdbversion are not defined\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user