working commit
This commit is contained in:
+29
-2
@@ -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);
|
||||
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user