mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-14 07:12:19 +00:00
feat: add user groups
This commit is contained in:
2
backend/migrations/20240924202721_user_groups.down.sql
Normal file
2
backend/migrations/20240924202721_user_groups.down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
DROP TABLE user_groups;
|
||||
DROP TABLE user_groups_users;
|
||||
16
backend/migrations/20240924202721_user_groups.up.sql
Normal file
16
backend/migrations/20240924202721_user_groups.up.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE user_groups
|
||||
(
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
created_at DATETIME,
|
||||
friendly_name TEXT NOT NULL,
|
||||
name TEXT NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
CREATE TABLE user_groups_users
|
||||
(
|
||||
user_id TEXT NOT NULL,
|
||||
user_group_id TEXT NOT NULL,
|
||||
PRIMARY KEY (user_id, user_group_id),
|
||||
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (user_group_id) REFERENCES user_groups (id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user