Update database functions to create and destroy rows in new table.

pull/20/head
knotteye 2021-01-09 15:25:06 -06:00
parent 5c22c1a738
commit 57410dc969
1 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ async function addUser(name: string, password: string){
await query('INSERT INTO user_meta (username, title, about, live) VALUES ('+raw.escape(name)+',\'\',\'\',false)');
await query('INSERT INTO chat_integration (username, irc, xmpp, twitch, discord) VALUES ('+raw.escape(name)+',\'\',\'\',\'\',\'\')');
await query('INSERT INTO twitch_mirror (username) VALUES ('+raw.escape(name)+')');
await query('INSERT INTO ch_bans(channel) VALUES ('+raw.escape(name)+')');
return true;
}
@ -40,6 +41,7 @@ async function rmUser(name: string){
await query('delete from user_meta where username='+raw.escape(name)+' limit 1');
await query('delete from chat_integration where username='+raw.escape(name)+' limit 1');
await query('delete from twitch_mirror where username='+raw.escape(name)+' limit 1');
await query('delete from ch_bans where username='+raw.escape(name)+' limit 1');
return true;
}