Add migration script for channel bans table in the database.
parent
a1a101c0f1
commit
5c22c1a738
|
@ -0,0 +1,9 @@
|
||||||
|
import * as db from "../database";
|
||||||
|
|
||||||
|
async function run () {
|
||||||
|
await db.query('CREATE TABLE IF NOT EXISTS ch_bans(channel VARCHAR(25), target VARCHAR(45), time BIGINT, length INT DEFAULT 30)');
|
||||||
|
await db.query('INSERT INTO ch_bans(channel) SELECT username FROM users');
|
||||||
|
await db.query('INSERT INTO db_meta (version) VALUES (3)');
|
||||||
|
}
|
||||||
|
|
||||||
|
export { run }
|
Reference in New Issue