basic file sharing
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE shares (
|
||||
id UUID PRIMARY KEY DEFAULT GEN_RANDOM_UUID(),
|
||||
creator_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
warren_id UUID NOT NULL REFERENCES warrens(id) ON DELETE CASCADE,
|
||||
path VARCHAR NOT NULL,
|
||||
password_hash VARCHAR NOT NULL,
|
||||
expires_at TIMESTAMP,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
21
backend/migrations/20250825115342_share_permissions.sql
Normal file
21
backend/migrations/20250825115342_share_permissions.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
ALTER TABLE
|
||||
user_warrens
|
||||
ADD COLUMN
|
||||
can_list_shares BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN
|
||||
can_create_shares BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN
|
||||
can_modify_shares BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN
|
||||
can_delete_shares BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
ALTER TABLE
|
||||
user_warrens
|
||||
ALTER COLUMN
|
||||
can_list_shares DROP DEFAULT,
|
||||
ALTER COLUMN
|
||||
can_create_shares DROP DEFAULT,
|
||||
ALTER COLUMN
|
||||
can_modify_shares DROP DEFAULT,
|
||||
ALTER COLUMN
|
||||
can_delete_shares DROP DEFAULT;
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE shares ALTER COLUMN password_hash DROP NOT NULL;
|
||||
1
backend/migrations/20250825150026_shares_path_index.sql
Normal file
1
backend/migrations/20250825150026_shares_path_index.sql
Normal file
@@ -0,0 +1 @@
|
||||
CREATE INDEX idx_shares_path ON shares(path);
|
||||
Reference in New Issue
Block a user