CyTube/update.js

22 lines
524 B
JavaScript
Raw Normal View History

2013-05-31 04:48:11 +00:00
var Config = require("./config.js");
var Database = require("./database.js");
Config.DEBUG = true;
Database.setup(Config);
Database.init();
var query;
var db = Database.getConnection();
// Check for already existing
query = "SELECT email FROM registrations WHERE 1";
if(!db.querySync(query)) {
query = "ALTER TABLE registrations ADD email VARCHAR(255) NOT NULL";
var res = db.querySync(query);
if(!res) {
console.log(db);
console.log("Update failed!");
}
}
db.closeSync();
process.exit(0);