Create ban table in Channel.createTables

This commit is contained in:
calzoneman 2013-03-23 22:02:54 -05:00
parent df54f8bffc
commit 3a585cbb60
1 changed files with 12 additions and 0 deletions

View File

@ -140,6 +140,18 @@ Channel.prototype.createTables = function() {
.replace(/\{\}/, this.name); .replace(/\{\}/, this.name);
results = db.querySync(query) || results; results = db.querySync(query) || results;
// Create ban table
var query = "CREATE TABLE `chan_{}_bans` (\
`ip` VARCHAR( 15 ) NOT NULL ,\
`name` VARCHAR( 32 ) NOT NULL ,\
`banner` VARCHAR( 32 ) NOT NULL ,\
PRIMARY KEY (\
`ip`\
)\
) ENGINE = MYISAM"
.replace(/\{\}/, this.name);
results = db.querySync(query) || results;
// Insert into global channel table // Insert into global channel table
var query = 'INSERT INTO channels (`id`, `name`) VALUES (NULL, "{}")' var query = 'INSERT INTO channels (`id`, `name`) VALUES (NULL, "{}")'
.replace(/\{\}/, this.name); .replace(/\{\}/, this.name);