Update initial tables
This commit is contained in:
14
express/migrations/2026-01-24_02-capabilities.sql
Normal file
14
express/migrations/2026-01-24_02-capabilities.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE capabilities (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT UNIQUE NOT NULL,
|
||||
description TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE role_capabilities (
|
||||
role_id UUID NOT NULL REFERENCES roles(id),
|
||||
capability_id UUID NOT NULL REFERENCES capabilities(id),
|
||||
granted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
revoked_at TIMESTAMPTZ,
|
||||
PRIMARY KEY (role_id, capability_id)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user