Separate framework and app migrations
Also add a new develop command: clear-db.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE roles (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT UNIQUE NOT NULL,
|
||||
description TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE groups (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE user_group_roles (
|
||||
user_id UUID NOT NULL REFERENCES users(id),
|
||||
group_id UUID NOT NULL REFERENCES groups(id),
|
||||
role_id UUID NOT NULL REFERENCES roles(id),
|
||||
granted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
revoked_at TIMESTAMPTZ,
|
||||
PRIMARY KEY (user_id, group_id, role_id)
|
||||
);
|
||||
Reference in New Issue
Block a user