Commit 4688502b authored by P. J. McDermott's avatar P. J. McDermott

Fix some SQL errors in gnukebox/install.php.

PostgreSQL seems to treat strings in double quotes as column names, even
if they're supposed to be sequence object names or column values.
parent e0b8c9c7
......@@ -167,7 +167,7 @@ if (isset($_POST['install'])) {
$stage_two_queries_other = array(
'CREATE SEQUENCE track_id_seq;',
'CREATE TABLE Track(
id INTEGER NOT NULL DEFAULT nextval("track_id_seq"::regclass) PRIMARY KEY,
id INTEGER NOT NULL DEFAULT nextval(\'track_id_seq\'::regclass) PRIMARY KEY,
name VARCHAR(255),
artist_name VARCHAR(255) REFERENCES Artist(name),
album_name VARCHAR(255),
......@@ -318,23 +318,23 @@ if (isset($_POST['install'])) {
PRIMARY KEY (uid1, uid2, flag),
FOREIGN KEY (uid1, uid2) REFERENCES User_Relationships (uid1, uid2))',
'INSERT INTO Relationship_Flags VALUES ("contact")',
'INSERT INTO Relationship_Flags VALUES ("acquaintance")',
'INSERT INTO Relationship_Flags VALUES ("friend")',
'INSERT INTO Relationship_Flags VALUES ("met")',
'INSERT INTO Relationship_Flags VALUES ("co-worker")',
'INSERT INTO Relationship_Flags VALUES ("colleague")',
'INSERT INTO Relationship_Flags VALUES ("co-resident")',
'INSERT INTO Relationship_Flags VALUES ("neighbor")',
'INSERT INTO Relationship_Flags VALUES ("child")',
'INSERT INTO Relationship_Flags VALUES ("parent")',
'INSERT INTO Relationship_Flags VALUES ("sibling")',
'INSERT INTO Relationship_Flags VALUES ("spouse")',
'INSERT INTO Relationship_Flags VALUES ("kin")',
'INSERT INTO Relationship_Flags VALUES ("muse")',
'INSERT INTO Relationship_Flags VALUES ("crush")',
'INSERT INTO Relationship_Flags VALUES ("date")',
'INSERT INTO Relationship_Flags VALUES ("sweetheart")'
'INSERT INTO Relationship_Flags VALUES (\'contact\')',
'INSERT INTO Relationship_Flags VALUES (\'acquaintance\')',
'INSERT INTO Relationship_Flags VALUES (\'friend\')',
'INSERT INTO Relationship_Flags VALUES (\'met\')',
'INSERT INTO Relationship_Flags VALUES (\'co-worker\')',
'INSERT INTO Relationship_Flags VALUES (\'colleague\')',
'INSERT INTO Relationship_Flags VALUES (\'co-resident\')',
'INSERT INTO Relationship_Flags VALUES (\'neighbor\')',
'INSERT INTO Relationship_Flags VALUES (\'child\')',
'INSERT INTO Relationship_Flags VALUES (\'parent\')',
'INSERT INTO Relationship_Flags VALUES (\'sibling\')',
'INSERT INTO Relationship_Flags VALUES (\'spouse\')',
'INSERT INTO Relationship_Flags VALUES (\'kin\')',
'INSERT INTO Relationship_Flags VALUES (\'muse\')',
'INSERT INTO Relationship_Flags VALUES (\'crush\')',
'INSERT INTO Relationship_Flags VALUES (\'date\')',
'INSERT INTO Relationship_Flags VALUES (\'sweetheart\')'
);
foreach ($stage_one_queries as $query) {
......@@ -392,7 +392,7 @@ if (isset($_POST['install'])) {
$adodb->Execute('INSERT INTO Users
(username, password, active)
VALUES
("testuser", "' . md5('password') . '", 1);');
(\'testuser\', \'' . md5('password') . '\', 1);');
} catch(Exception $e) {
die('Error testing database: ' . $adodb->ErrorMsg());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment