bunch of shit
This commit is contained in:
parent
3cf2ec38aa
commit
0f577eef4d
22 changed files with 2889 additions and 37 deletions
|
|
@ -28,7 +28,35 @@ const initDb = async () => {
|
|||
ALTER TABLE users ADD COLUMN IF NOT EXISTS pid INTEGER;
|
||||
`)
|
||||
|
||||
console.log('[DB INIT]: Table "users" checked/updated successfully.')
|
||||
await pool.query(`
|
||||
CREATE TABLE IF NOT EXISTS audit_logs (
|
||||
id SERIAL PRIMARY KEY,
|
||||
log_id VARCHAR(255) UNIQUE NOT NULL,
|
||||
editor_sfid VARCHAR(255),
|
||||
editor_pid INTEGER,
|
||||
target_name VARCHAR(255),
|
||||
target_pid INTEGER,
|
||||
changes JSONB NOT NULL,
|
||||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
`)
|
||||
|
||||
await pool.query(`
|
||||
CREATE TABLE IF NOT EXISTS ban_logs (
|
||||
id SERIAL PRIMARY KEY,
|
||||
log_id VARCHAR(255) UNIQUE NOT NULL,
|
||||
target_pid INTEGER NOT NULL,
|
||||
target_name VARCHAR(255),
|
||||
editor_sfid VARCHAR(255),
|
||||
editor_pid INTEGER,
|
||||
ban_level INTEGER NOT NULL,
|
||||
reason VARCHAR(255) NOT NULL,
|
||||
mod_note TEXT NOT NULL,
|
||||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
`)
|
||||
|
||||
console.log('[DB INIT]: Tables "users", "audit_logs", and "ban_logs" checked/updated successfully.')
|
||||
} catch (err) {
|
||||
console.error('[DB INIT ERROR]:', err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue