working commit

This commit is contained in:
2026-02-07 11:24:30 +02:00
parent f76881a765
commit 90905ace89
6 changed files with 102 additions and 21 deletions
+8 -9
View File
@@ -22,7 +22,7 @@ const schema = `
created_by VARCHAR(255) NOT NULL,
updated_by VARCHAR(255) NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS file_index
CREATE UNIQUE INDEX IF NOT EXISTS files_index
ON files(collection, name);
--- DROP TABLE IF EXISTS manifests;
@@ -38,7 +38,7 @@ const schema = `
created_by VARCHAR(255) NOT NULL,
updated_by VARCHAR(255) NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS manifest_index
CREATE UNIQUE INDEX IF NOT EXISTS manifests_index
ON manifests(name, reference);
CREATE TABLE IF NOT EXISTS blobs (
@@ -57,7 +57,7 @@ const schema = `
ON blobs(name, reference, digest);
--- DROP TABLE IF EXISTS accounts;
CREATE TABLE IF NOT EXISTS account (
CREATE TABLE IF NOT EXISTS accounts (
id INT NOT NULL,
username TEXT NOT NULL,
passhash TEXT NOT NULL,
@@ -65,22 +65,21 @@ const schema = `
updated_at TEXT NOT NULL,
disabled BOOL
);
CREATE UNIQUE INDEX IF NOT EXISTS account_index01
CREATE UNIQUE INDEX IF NOT EXISTS accounts_index01
ON accounts(id);
CREATE UNIQUE INDEX IF NOT EXISTS account_index02
CREATE UNIQUE INDEX IF NOT EXISTS accounts_index02
ON accounts(username);
--- DROP TABLE IF EXISTS grants;
CREATE TABLE IF NOT EXISTS grant (
CREATE TABLE IF NOT EXISTS grants (
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
CREATE INDEX IF NOT EXISTS grants_index01
ON grants(account_id);
CREATE UNIQUE INDEX IF NOT EXISTS grant_index02
CREATE UNIQUE INDEX IF NOT EXISTS grants_index02
ON grants(account_id, operation);
`