forked from rbatis/abs_admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_postgres.sql
190 lines (167 loc) · 7.83 KB
/
db_postgres.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dict";
CREATE TABLE "public"."sys_dict" (
"id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"name" varchar(512) COLLATE "pg_catalog"."default" NOT NULL,
"code" varchar(512) COLLATE "pg_catalog"."default" NOT NULL,
"state" int4 NOT NULL,
"create_date" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."sys_dict" OWNER TO "postgres";
-- ----------------------------
-- Records of sys_dict
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_permission";
CREATE TABLE "public"."sys_permission" (
"id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"parent_id" varchar(256) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"name" varchar(256) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"permission" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"path" varchar(256) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"del" int4 DEFAULT 1,
"create_date" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."sys_permission" OWNER TO "postgres";
COMMENT ON COLUMN "public"."sys_permission"."create_date" IS '创建时间';
-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO "public"."sys_permission" VALUES ('1', NULL, '/', '/', '/', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('2', NULL, 'dashboard', 'dashboard', 'dashboard', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('3', NULL, 'form', 'form', 'form', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('4', NULL, 'table', 'table', 'table', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('5', NULL, 'profile', 'profile', 'profile', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('6', NULL, 'result', 'result', 'result', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('7', NULL, 'exception', 'exception', 'exception', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('8', NULL, 'user', 'user', 'user', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('9', NULL, 'setting', 'setting', 'setting', 0, '2020-02-09 00:00:00');
INSERT INTO "public"."sys_permission" VALUES ('10', NULL, '超级管理员权限', '/', '', 0, '2020-08-13 11:43:26');
COMMIT;
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role";
CREATE TABLE "public"."sys_role" (
"id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"name" varchar(256) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"del" int4 NOT NULL DEFAULT 1,
"create_date" timestamp(6) NOT NULL,
"parent_id" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."sys_role" OWNER TO "postgres";
COMMENT ON COLUMN "public"."sys_role"."parent_id" IS '父id';
-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO "public"."sys_role" VALUES ('1', 'super', 0, '2020-07-28 08:34:40', NULL);
COMMIT;
-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_permission";
CREATE TABLE "public"."sys_role_permission" (
"id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"role_id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"permission_id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"create_date" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."sys_role_permission" OWNER TO "postgres";
-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO "public"."sys_role_permission" VALUES ('1', '1', '1', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('2', '1', '2', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('3', '1', '3', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('4', '1', '4', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('5', '1', '5', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('6', '1', '6', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('7', '1', '7', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('8', '1', '8', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('9', '1', '9', '2020-07-28 08:34:40');
INSERT INTO "public"."sys_role_permission" VALUES ('10', '1', '10', '2020-07-28 08:34:40');
COMMIT;
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user";
CREATE TABLE "public"."sys_user" (
"id" varchar(45) COLLATE "pg_catalog"."default" NOT NULL,
"account" varchar(45) COLLATE "pg_catalog"."default" NOT NULL,
"password" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"name" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"login_check" varchar(255) COLLATE "pg_catalog"."default" DEFAULT 'PasswordQRCodeCheck'::character varying,
"del" int4 NOT NULL DEFAULT 1,
"create_date" timestamp(6) NOT NULL,
"state" int4 NOT NULL DEFAULT 1
)
;
ALTER TABLE "public"."sys_user" OWNER TO "postgres";
-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO "public"."sys_user" VALUES ('1', '00000000000', 'e10adc3949ba59abbe56e057f20f883e', '超级管理员', 'PasswordCheck', 0, '2020-07-28 08:34:40', 1);
COMMIT;
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user_role";
CREATE TABLE "public"."sys_user_role" (
"id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"user_id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"role_id" varchar(256) COLLATE "pg_catalog"."default" NOT NULL,
"create_date" timestamp(6) NOT NULL
)
;
ALTER TABLE "public"."sys_user_role" OWNER TO "postgres";
create table sys_trash
(
id varchar(256) not null,
table_name varchar(256) not null,
data text null,
create_date timestamp(6) null
);
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO "public"."sys_user_role" VALUES ('1', '205667537625681919', '1', '2020-07-28 08:34:40');
COMMIT;
-- ----------------------------
-- Primary Key structure for table sys_dict
-- ----------------------------
ALTER TABLE "public"."sys_dict" ADD CONSTRAINT "sys_dict_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table sys_permission
-- ----------------------------
ALTER TABLE "public"."sys_permission" ADD CONSTRAINT "sys_permission_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table sys_role
-- ----------------------------
ALTER TABLE "public"."sys_role" ADD CONSTRAINT "sys_role_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table sys_role_permission
-- ----------------------------
ALTER TABLE "public"."sys_role_permission" ADD CONSTRAINT "sys_role_permission_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table sys_user
-- ----------------------------
ALTER TABLE "public"."sys_user" ADD CONSTRAINT "sys_user_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table sys_user_role
-- ----------------------------
ALTER TABLE "public"."sys_user_role" ADD CONSTRAINT "sys_user_role_pkey" PRIMARY KEY ("id");