Browse Source

(+)权限脚本

master
ww664853070 1 year ago
parent
commit
488f14e11b
  1. 26
      doc/scripts/v3.22.1/1create_table_role.sql
  2. 34
      doc/scripts/v3.22.1/2create_table_resource.sql
  3. 25
      doc/scripts/v3.22.1/3create_table_role_resource.sql
  4. 25
      doc/scripts/v3.22.1/4create_table_user_role.sql

26
doc/scripts/v3.22.1/1create_table_role.sql

@ -0,0 +1,26 @@
CREATE SEQUENCE "public"."resource_table_role_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE "public"."role" (
"id" int4 NOT NULL DEFAULT nextval('resource_table_role_seq'::regclass),
"name" varchar(255) COLLATE "pg_catalog"."default",
"data_range" int4,
"delete" bool NOT NULL,
PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."role"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."role"."name" IS '角色名称';
COMMENT ON COLUMN "public"."role"."data_range" IS '1全公司2本部门';
COMMENT ON COLUMN "public"."role"."delete" IS '收否删除';

34
doc/scripts/v3.22.1/2create_table_resource.sql

@ -0,0 +1,34 @@
CREATE SEQUENCE "public"."resource_table_resource_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE "public"."resource" (
"id" int4 NOT NULL DEFAULT nextval('resource_table_resource_seq'::regclass),
"name" varchar(255) COLLATE "pg_catalog"."default",
"code" varchar(255) COLLATE "pg_catalog"."default",
"parent_id" int4,
"order" int4,
"create_time" timestamp(6),
PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."resource"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."resource"."name" IS '权限名称';
COMMENT ON COLUMN "public"."resource"."code" IS '权限码';
COMMENT ON COLUMN "public"."resource"."order" IS '排序';
COMMENT ON COLUMN "public"."resource"."parent_id" IS '父级id';
COMMENT ON COLUMN "public"."resource"."create_time" IS '创建时间';

25
doc/scripts/v3.22.1/3create_table_role_resource.sql

@ -0,0 +1,25 @@
CREATE SEQUENCE "public"."resource_table_role_resource_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE "public"."role_resource" (
"id" int4 NOT NULL DEFAULT nextval('resource_table_role_resource_seq'::regclass),
"role_id" int4,
"res_id" int4,
PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."role_resource"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."role_resource"."role_id" IS '角色id';
COMMENT ON COLUMN "public"."role_resource"."res_id" IS '权限id';

25
doc/scripts/v3.22.1/4create_table_user_role.sql

@ -0,0 +1,25 @@
CREATE SEQUENCE "public"."resource_table_user_role_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE "public"."user_role" (
"id" int4 NOT NULL DEFAULT nextval('resource_table_user_role_seq'::regclass),
"role_id" int4,
"user_id" int4,
PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."user_role"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."user_role"."role_id" IS '角色id';
COMMENT ON COLUMN "public"."user_role"."user_id" IS '用户id';
Loading…
Cancel
Save