Add migration script for channel bans table in the database.

pull/20/head
knotteye 2021-01-09 15:22:23 -06:00
parent a1a101c0f1
commit 5c22c1a738
1 changed files with 9 additions and 0 deletions

9
src/db/3.ts Normal file
View File

@ -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 }