refactor: ♻️ permission system
This commit is contained in:
parent
29ce92bdf7
commit
00d6bd5b93
7 changed files with 43 additions and 100 deletions
|
@ -1,5 +1,5 @@
|
|||
-- Add up migration script here
|
||||
CREATE TABLE IF NOT EXISTS "interaction"(
|
||||
id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE,
|
||||
name VARCHAR(10) UNIQUE NOT NULL
|
||||
name VARCHAR(50) UNIQUE NOT NULL
|
||||
);
|
1
migrations/20241213115604_permission.down.sql
Normal file
1
migrations/20241213115604_permission.down.sql
Normal file
|
@ -0,0 +1 @@
|
|||
-- Add down migration script here
|
5
migrations/20241213115604_permission.up.sql
Normal file
5
migrations/20241213115604_permission.up.sql
Normal file
|
@ -0,0 +1,5 @@
|
|||
-- Add up migration script here
|
||||
CREATE TABLE IF NOT EXISTS "permission"(
|
||||
id BIGSERIAL PRIMARY KEY UNIQUE NOT NULL,
|
||||
name VARCHAR(50) UNIQUE NOT NULL
|
||||
);
|
2
migrations/20241213120203_role_permission.down.sql
Normal file
2
migrations/20241213120203_role_permission.down.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- Add down migration script here
|
||||
DROP TABLE IF EXISTS "role_permission";
|
6
migrations/20241213120203_role_permission.up.sql
Normal file
6
migrations/20241213120203_role_permission.up.sql
Normal file
|
@ -0,0 +1,6 @@
|
|||
-- Add up migration script here
|
||||
CREATE TABLE IF NOT EXISTS "role_permission"(
|
||||
role_id BIGSERIAL NOT NULL REFERENCES "role"(id),
|
||||
permission_id BIGSERIAL NOT NULL REFERENCES "permission"(id),
|
||||
PRIMARY KEY (role_id, permission_id)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue