chore: import MCTF services
- Added all seven issued service trees without omissions. - Preserved the supplied runtime configuration, binaries, and assets.
This commit is contained in:
commit
13f936bee9
1222 files changed
+21280
No files matched your search
+43
@@ -0,0 +1,43 @@
|
||||
CREATE TABLE workspaces (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
title VARCHAR(100) NOT NULL UNIQUE,
|
||||
description TEXT,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE TYPE role AS ENUM (
|
||||
'user',
|
||||
'workspace_admin'
|
||||
);
|
||||
|
||||
CREATE TABLE users (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
username VARCHAR(30) NOT NULL UNIQUE,
|
||||
workspace_id UUID REFERENCES workspaces(id),
|
||||
role role NOT NULL DEFAULT 'user',
|
||||
created_at TIMESTAMP NOT NULL DEFAULT now(),
|
||||
UNIQUE (workspace_id, username)
|
||||
);
|
||||
|
||||
CREATE TABLE sessions (
|
||||
user_id UUID PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
|
||||
cookie VARCHAR(50) NOT NULL UNIQUE,
|
||||
expires_at TIMESTAMP NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE files (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
name VARCHAR(100) NOT NULL,
|
||||
filename VARCHAR(100) NOT NULL,
|
||||
owner_id UUID NOT NULL REFERENCES users(id),
|
||||
size BIGINT NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE TABLE auth_policies (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
name VARCHAR(100) NOT NULL DEFAULT 'policy.conf',
|
||||
filename VARCHAR(100) NOT NULL,
|
||||
workspace_id UUID NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
|
||||
UNIQUE (workspace_id, filename)
|
||||
);
|
||||
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE files
|
||||
ADD COLUMN workspace_id UUID NULL REFERENCES workspaces(id) ON DELETE CASCADE;
|
||||
|
||||
UPDATE files
|
||||
SET workspace_id = users.workspace_id
|
||||
FROM users
|
||||
WHERE users.id = files.owner_id;
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE files
|
||||
ADD COLUMN is_public BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
Reference in new issue
Block a user