Add migration script for channel bans table in the database.

pull/20/head
knotteye 3 years ago
parent a1a101c0f1
commit 5c22c1a738
  1. 9
      src/db/3.ts

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