Update database functions to create and destroy rows in new table.
parent
5c22c1a738
commit
57410dc969
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue