diff --git a/core/database.class.php b/core/database.class.php index 3b7b3ed1..2880684b 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -72,6 +72,7 @@ class MySQL extends DBEngine { $data = str_replace("SCORE_BOOL_Y", "'Y'", $data); $data = str_replace("SCORE_BOOL_N", "'N'", $data); $data = str_replace("SCORE_BOOL", "ENUM('Y', 'N')", $data); + $data = str_replace("SCORE_DATETIME", "DATETIME", $data); $data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data); $ctes = "TYPE=InnoDB DEFAULT CHARSET='utf8'"; return "CREATE TABLE $name ($data) $ctes"; @@ -86,6 +87,7 @@ class PostgreSQL extends DBEngine { $data = str_replace("SCORE_BOOL_Y", "'t'", $data); $data = str_replace("SCORE_BOOL_N", "'f'", $data); $data = str_replace("SCORE_BOOL", "BOOL", $data); + $data = str_replace("SCORE_DATETIME", "TIMESTAMP", $data); $data = str_replace("SCORE_NOW", "current_time", $data); return "CREATE TABLE $name ($data)"; } diff --git a/install.php b/install.php index d87d8a1b..bb869e5a 100644 --- a/install.php +++ b/install.php @@ -197,7 +197,7 @@ function create_tables($dsn) { // {{{ id SCORE_AIPK, name VARCHAR(32) UNIQUE NOT NULL, pass CHAR(32), - joindate DATETIME NOT NULL DEFAULT SCORE_NOW, + joindate SCORE_DATETIME NOT NULL DEFAULT SCORE_NOW, admin SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N, email VARCHAR(128) ")); @@ -212,7 +212,7 @@ function create_tables($dsn) { // {{{ source VARCHAR(255), width INTEGER NOT NULL, height INTEGER NOT NULL, - posted TIMESTAMP NOT NULL DEFAULT SCORE_NOW, + posted SCORE_DATETIME NOT NULL DEFAULT SCORE_NOW, locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N, INDEX(owner_id), INDEX(width),