working commit

This commit is contained in:
2026-02-06 19:15:12 +02:00
parent fe91517e3f
commit f76881a765
14 changed files with 478 additions and 20 deletions
+29 -2
View File
@@ -10,7 +10,7 @@
package maindb
const schema = `
CREATE TABLE IF NOT EXISTS file (
CREATE TABLE IF NOT EXISTS files (
id VARCHAR(255) NOT NULL,
collection VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
@@ -23,7 +23,7 @@ const schema = `
updated_by VARCHAR(255) NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS file_index
ON file(collection, name);
ON files(collection, name);
--- DROP TABLE IF EXISTS manifests;
CREATE TABLE IF NOT EXISTS manifests (
@@ -56,4 +56,31 @@ const schema = `
CREATE UNIQUE INDEX IF NOT EXISTS blobs_index
ON blobs(name, reference, digest);
--- DROP TABLE IF EXISTS accounts;
CREATE TABLE IF NOT EXISTS account (
id INT 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 accounts(id);
CREATE UNIQUE INDEX IF NOT EXISTS account_index02
ON accounts(username);
--- DROP TABLE IF EXISTS grants;
CREATE TABLE IF NOT EXISTS grant (
id INT NOT NULL,
account_id INT NOT NULL,
operation TEXT NOT NULL,
created_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS grant_index01
ON grants(account_id);
CREATE UNIQUE INDEX IF NOT EXISTS grant_index02
ON grants(account_id, operation);
`