Fix #205 (run update.js)

This commit is contained in:
Calvin Montgomery 2013-07-09 20:28:54 +04:00
parent 86df9775ac
commit 68146043ad
2 changed files with 10 additions and 1 deletions

View file

@ -168,7 +168,7 @@ function init() {
"`contents` MEDIUMTEXT NOT NULL,", "`contents` MEDIUMTEXT NOT NULL,",
"`count` INT NOT NULL,", "`count` INT NOT NULL,",
"`time` INT NOT NULL,", "`time` INT NOT NULL,",
"PRIMARY KEY (`name`))", "PRIMARY KEY (`user`, `name`))",
"ENGINE = MyISAM;"].join(""); "ENGINE = MyISAM;"].join("");
results = db.querySync(query); results = db.querySync(query);
if(!results) { if(!results) {

View file

@ -20,6 +20,15 @@ if(!db.querySync(query)) {
populateChannelOwners(); populateChannelOwners();
} }
} }
console.log("Fixing user playlist bug");
query = "ALTER TABLE user_playlists DROP PRIMARY KEY, ADD PRIMARY KEY (user, name)";
if(!db.querySync(query)) {
console.log("Something went wrong");
}
else {
console.log("fixed");
}
db.closeSync(); db.closeSync();
process.exit(0); process.exit(0);