Files
gmbase/app/maindb/schema.go
T
2026-06-09 14:10:53 +02:00

30 lines
839 B
Go

package maindb
const schema = `
--- DROP TABLE IF EXISTS account;
CREATE TABLE IF NOT EXISTS account (
id TEXT NOT NULL,
username TEXT NOT NULL,
passhash TEXT NOT NULL,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
disabled BOOL
);
CREATE UNIQUE INDEX IF NOT EXISTS account_index01
ON account(id);
CREATE UNIQUE INDEX IF NOT EXISTS account_index02
ON account(username);
--- DROP TABLE IF EXISTS grant;
CREATE TABLE IF NOT EXISTS grant (
id TEXT NOT NULL,
account_id TEXT NOT NULL,
grantname TEXT NOT NULL,
created_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS grant_index01
ON grant(account_id);
CREATE UNIQUE INDEX IF NOT EXISTS grant_index02
ON grant(account_id, grantname);
`