generated from azures04/Base-REST-API
Introduce DB support and repos: add modules/database.js (connection pool + runDDL) and SQL DDL files (data/ddl/*) for servers, users, providers, identities and credentials. Add repository layers: users, servers, providers, identities, credentials. Update server.js to run DDL at startup. Update .env.example with DB settings and bump dependencies in package.json/package-lock.json (add mariadb, bump dotenv/helmet/path-to-regexp/zod and dev tool upgrades). Error handling and logging included for DDL and repo operations.
8 lines
285 B
SQL
8 lines
285 B
SQL
CREATE TABLE IF NOT EXISTS `providers` (
|
|
`id` UUID PRIMARY KEY DEFAULT UUID(),
|
|
`name` VARCHAR(64) NOT NULL UNIQUE,
|
|
`issuerUrl` TEXT NOT NULL,
|
|
`issuerLogo` TEXT,
|
|
`isEnabled` BOOLEAN NOT NULL DEFAULT TRUE,
|
|
`createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
) |