fix
All checks were successful
build-and-deploy / build (push) Successful in 8s
build-and-deploy / deploy (push) Successful in 5s

This commit is contained in:
2025-09-26 20:35:21 -06:00
parent d125c03556
commit c6a758f87a

View File

@@ -8,6 +8,27 @@ export async function ensureSchema() {
const client = await pool.connect(); const client = await pool.connect();
try { try {
await client.query('BEGIN'); await client.query('BEGIN');
// Minimal FreeRADIUS tables used by the app
await client.query(`
CREATE TABLE IF NOT EXISTS radcheck (
id SERIAL PRIMARY KEY,
username VARCHAR(64) NOT NULL DEFAULT '',
attribute VARCHAR(64) NOT NULL DEFAULT '',
op CHAR(2) NOT NULL DEFAULT ':=',
value VARCHAR(253) NOT NULL DEFAULT ''
);
`);
await client.query(`
CREATE TABLE IF NOT EXISTS radreply (
id SERIAL PRIMARY KEY,
username VARCHAR(64) NOT NULL DEFAULT '',
attribute VARCHAR(64) NOT NULL DEFAULT '',
op CHAR(2) NOT NULL DEFAULT ':=',
value VARCHAR(253) NOT NULL DEFAULT ''
);
`);
await client.query(`CREATE INDEX IF NOT EXISTS radcheck_user ON radcheck (username);`);
await client.query(`CREATE INDEX IF NOT EXISTS radreply_user ON radreply (username);`);
await client.query(` await client.query(`
CREATE TABLE IF NOT EXISTS vlans ( CREATE TABLE IF NOT EXISTS vlans (
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,