bug fixed

This commit is contained in:
병준 박 2022-08-06 11:51:49 +00:00
parent 34a61cd2c8
commit 3fe026a0ff
2 changed files with 9 additions and 9 deletions

View File

@ -1,3 +1,3 @@
DROP INDEX idx_member_permissions_resource_action_id;
DROP INDEX idx_member_permissions_member_id;
DROP INDEX idx_member_permissions_role_id;
DROP TABLE member_permissions;

View File

@ -1,15 +1,15 @@
CREATE TABLE IF NOT EXISTS member_permissions (
member_id UUID NOT NULL,
role_resource_action_id UUID NOT NULL,
resource_action_id UUID NOT NULL,
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
PRIMARY KEY (member_id, role_resource_action_id),
PRIMARY KEY (member_id, resource_action_id),
CONSTRAINT fk_member_permissions_member_id
FOREIGN KEY(member_id)
REFERENCES members(id),
CONSTRAINT fk_member_permissions_role_id
FOREIGN KEY(role_id)
REFERENCES roles(id)
CONSTRAINT fk_member_permissions_resource_action_id
FOREIGN KEY(resource_action_id)
REFERENCES resource_actions(id)
);
CREATE INDEX idx_member_permissions_role_id ON member_permissions (role_id);
CREATE INDEX idx_member_permissions_resource_action_id ON member_permissions (resource_action_id);
CREATE INDEX idx_member_permissions_member_id ON member_permissions (member_id);