-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add manager_permissions and manager_user_permissions tables (#193)
- Loading branch information
Showing
5 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
migrations/1731853654084_create_table_public_manager_permissions/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."manager_permissions"; |
2 changes: 2 additions & 0 deletions
2
migrations/1731853654084_create_table_public_manager_permissions/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CREATE TABLE "public"."manager_permissions" ("permission_id" uuid NOT NULL DEFAULT gen_random_uuid(), "name" text NOT NULL, "description" text, "created_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("permission_id") , UNIQUE ("permission_id"), UNIQUE ("name"), UNIQUE ("description"));COMMENT ON TABLE "public"."manager_permissions" IS E'管理员权限列表'; | ||
CREATE EXTENSION IF NOT EXISTS pgcrypto; |
1 change: 1 addition & 0 deletions
1
migrations/1731853941445_create_table_public_manager_user_permissions/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."manager_user_permissions"; |
1 change: 1 addition & 0 deletions
1
migrations/1731853941445_create_table_public_manager_user_permissions/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE "public"."manager_user_permissions" ("uuid" uuid NOT NULL, "permission_id" uuid NOT NULL, "granted_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("uuid","permission_id") , FOREIGN KEY ("uuid") REFERENCES "public"."users"("uuid") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("permission_id") REFERENCES "public"."manager_permissions"("permission_id") ON UPDATE restrict ON DELETE restrict);COMMENT ON TABLE "public"."manager_user_permissions" IS E'每个管理员账户的权限'; |