mirror of https://github.com/BOINC/boinc.git
web: Fix issue caused by MariaDB 10.2 allowing column defaults to use
functions but earlier versions and MySQL not allowing it
This commit is contained in:
parent
ad28e831b6
commit
638f8284a7
|
@ -767,7 +767,7 @@ create table token (
|
|||
token varchar(255) not null,
|
||||
userid integer not null,
|
||||
type char not null,
|
||||
create_time integer not null default unix_timestamp(),
|
||||
create_time integer not null,
|
||||
expire_time integer,
|
||||
primary key (token),
|
||||
index token_userid (userid)
|
||||
|
|
|
@ -783,10 +783,11 @@ class BoincToken {
|
|||
return $db->lookup('token', 'BoincToken', $clause);
|
||||
}
|
||||
|
||||
static function lookup_valid_token($userid, $token) {
|
||||
static function lookup_valid_token($userid, $token, $type) {
|
||||
$db = BoincDb::get();
|
||||
$token = BoincDb::escape_string($token);
|
||||
return self::lookup("userid=$userid and token='$token' and expire_time > unix_timestamp()");
|
||||
$type = BoincDb::escape_string($type);
|
||||
return self::lookup("userid=$userid and token='$token' and expire_time > unix_timestamp() and type = '$type'");
|
||||
}
|
||||
|
||||
static function enum($where_clause) {
|
||||
|
|
|
@ -1080,7 +1080,7 @@ function update_4_5_2018() {
|
|||
token varchar(255) not null,
|
||||
userid integer not null,
|
||||
type char not null,
|
||||
create_time integer not null default unix_timestamp(),
|
||||
create_time integer not null,
|
||||
expire_time integer,
|
||||
primary key (token),
|
||||
index token_userid (userid)
|
||||
|
@ -1096,6 +1096,12 @@ function update_4_6_2018() {
|
|||
");
|
||||
}
|
||||
|
||||
function update_4_18_2018() {
|
||||
do_query("alter table token
|
||||
modify column create_time integer not null
|
||||
");
|
||||
}
|
||||
|
||||
// Updates are done automatically if you use "upgrade".
|
||||
//
|
||||
// If you need to do updates manually,
|
||||
|
@ -1151,6 +1157,7 @@ $db_updates = array (
|
|||
array(27021, "update_3_8_2018"),
|
||||
array(27022, "update_4_5_2018"),
|
||||
array(27023, "update_4_6_2018"),
|
||||
array(27024, "update_4_18_2018")
|
||||
);
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue