php developers can go choke on a bucket of cocks

This commit is contained in:
Shish 2009-01-22 04:11:43 -08:00
parent 44ac62e1ae
commit f347384a50
2 changed files with 13 additions and 13 deletions

View File

@ -68,12 +68,12 @@ class MySQL extends DBEngine {
}
public function create_table_sql($name, $data) {
$data = str_replace($data, "SCORE_AIPK", "INTEGER PRIMARY KEY auto_increment");
$data = str_replace($data, "SCORE_INET", "CHAR(15)");
$data = str_replace($data, "SCORE_BOOL", "ENUM('Y', 'N')");
$data = str_replace($data, "SCORE_BOOL_Y", "'Y'");
$data = str_replace($data, "SCORE_BOOL_N", "'N'");
$data = str_replace($data, "SCORE_NOW", "now()");
$data = str_replace("SCORE_AIPK", "INTEGER PRIMARY KEY auto_increment", $data);
$data = str_replace("SCORE_INET", "CHAR(15)", $data);
$data = str_replace("SCORE_BOOL", "ENUM('Y', 'N')", $data);
$data = str_replace("SCORE_BOOL_Y", "'Y'", $data);
$data = str_replace("SCORE_BOOL_N", "'N'", $data);
$data = str_replace("SCORE_NOW", "now()", $data);
$ctes = "TYPE=InnoDB DEFAULT CHARSET='utf8'";
return "CREATE TABLE $name ($data) $ctes";
}
@ -85,12 +85,12 @@ class PostgreSQL extends DBEngine {
}
public function create_table_sql($name, $data) {
$data = str_replace($data, "SCORE_AIPK", "SERIAL PRIMARY KEY");
$data = str_replace($data, "SCORE_INET", "INET");
$data = str_replace($data, "SCORE_BOOL", "BOOL",);
$data = str_replace($data, "SCORE_BOOL_Y", "'t'");
$data = str_replace($data, "SCORE_BOOL_N", "'f'");
$data = str_replace($data, "SCORE_NOW", "current_time");
$data = str_replace("SCORE_AIPK", "SERIAL PRIMARY KEY", $data);
$data = str_replace("SCORE_INET", "INET", $data);
$data = str_replace("SCORE_BOOL", "BOOL", $data);
$data = str_replace("SCORE_BOOL_Y", "'t'", $data);
$data = str_replace("SCORE_BOOL_N", "'f'", $data);
$data = str_replace("SCORE_NOW", "current_time", $data);
return "CREATE TABLE $name ($data)";
}
}

View File

@ -179,7 +179,7 @@ function create_tables($dsn) { // {{{
id SCORE_AIPK,
name VARCHAR(32) NOT NULL,
pass CHAR(32),
joindate DATATIME NOT NULL DEFAULT SCORE_NOW,
joindate DATETIME NOT NULL DEFAULT SCORE_NOW,
admin SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N,
email VARCHAR(128),
INDEX(name)