/*
 Navicat Premium Data Transfer

 Source Server         : PG
 Source Server Type    : PostgreSQL
 Source Server Version : 150002 (150002)
 Source Host           : localhost:5432
 Source Catalog        : lcsharing
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 150002 (150002)
 File Encoding         : 65001

 Date: 24/01/2024 10:23:41
*/


-- ----------------------------
-- Sequence structure for lc_interface_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."lc_interface_id_seq";
CREATE SEQUENCE "public"."lc_interface_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;

-- ----------------------------
-- Sequence structure for lc_menu_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."lc_menu_id_seq";
CREATE SEQUENCE "public"."lc_menu_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;

-- ----------------------------
-- Sequence structure for lc_role_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."lc_role_id_seq";
CREATE SEQUENCE "public"."lc_role_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;

-- ----------------------------
-- Table structure for lc_interface
-- ----------------------------
DROP TABLE IF EXISTS "public"."lc_interface";
CREATE TABLE "public"."lc_interface" (
  "id" int4 NOT NULL DEFAULT nextval('lc_interface_id_seq'::regclass),
  "interface_name" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "resource" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "role_ids" varchar(30) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "create_time" timestamp(6),
  "update_time" timestamp(6),
  "request_method" varchar(6) COLLATE "pg_catalog"."default" DEFAULT 'GET'::character varying
)
;
COMMENT ON COLUMN "public"."lc_interface"."role_ids" IS '冗余字段，用于存储此接口那个角色可以访问';
COMMENT ON COLUMN "public"."lc_interface"."request_method" IS '请求方式';
COMMENT ON TABLE "public"."lc_interface" IS '接口表，主要用于控制后端接口权限';

-- ----------------------------
-- Records of lc_interface
-- ----------------------------
INSERT INTO "public"."lc_interface" VALUES (1, '保存人员', '/person', '2', NULL, NULL, 'POST');
INSERT INTO "public"."lc_interface" VALUES (2, '人员列表', '/person', '2', NULL, NULL, 'GET');

-- ----------------------------
-- Table structure for lc_menu
-- ----------------------------
DROP TABLE IF EXISTS "public"."lc_menu";
CREATE TABLE "public"."lc_menu" (
  "id" int4 NOT NULL DEFAULT nextval('lc_menu_id_seq'::regclass),
  "menu_name" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "resource" varchar(30) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6),
  "update_time" timestamp(6),
  "parent" int4 DEFAULT 0
)
;
COMMENT ON COLUMN "public"."lc_menu"."parent" IS '关联父菜单';
COMMENT ON TABLE "public"."lc_menu" IS '菜单表，主要用于控制前端列表权限';

-- ----------------------------
-- Records of lc_menu
-- ----------------------------
INSERT INTO "public"."lc_menu" VALUES (1, '人员列表', '/person', '2023-07-20 10:26:57', NULL, 0);
INSERT INTO "public"."lc_menu" VALUES (2, 'a', '/a', NULL, NULL, 1);
INSERT INTO "public"."lc_menu" VALUES (3, 'b', '/b', '2023-07-22 10:49:59', NULL, 0);
INSERT INTO "public"."lc_menu" VALUES (4, 'c', '/c', NULL, NULL, 3);
INSERT INTO "public"."lc_menu" VALUES (5, 'd', '/d', NULL, NULL, 3);
INSERT INTO "public"."lc_menu" VALUES (6, 'e', '/e', NULL, NULL, 5);

-- ----------------------------
-- Table structure for lc_person
-- ----------------------------
DROP TABLE IF EXISTS "public"."lc_person";
CREATE TABLE "public"."lc_person" (
  "id" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "username" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "email" varchar(25) COLLATE "pg_catalog"."default" NOT NULL,
  "password" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "enable" int2 NOT NULL DEFAULT 1,
  "status" int2 NOT NULL DEFAULT 0,
  "ip" char(12) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6),
  "update_time" timestamp(6),
  "role_id" int4 NOT NULL DEFAULT 1,
  "salt" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "is_del" int2 NOT NULL DEFAULT 0,
  "update_name" varchar(16) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."lc_person"."enable" IS '是否启用';
COMMENT ON COLUMN "public"."lc_person"."status" IS '状态，0为注册了但是未通过邮箱验证，1表示正常';
COMMENT ON COLUMN "public"."lc_person"."role_id" IS '外键，角色id';
COMMENT ON COLUMN "public"."lc_person"."salt" IS '盐';
COMMENT ON COLUMN "public"."lc_person"."is_del" IS '0未删除，1删除';
COMMENT ON COLUMN "public"."lc_person"."update_name" IS '修改人';
COMMENT ON TABLE "public"."lc_person" IS '账户表';

-- ----------------------------
-- Records of lc_person
-- ----------------------------
INSERT INTO "public"."lc_person" VALUES ('1680197396198248449', 'zB88NObo', '780771603@qq.com', 'b9d7c1c558b959b888f9187bfd6f78a1', 1, 0, '127.0.0.1   ', '2023-07-15 20:47:30.472188', NULL, 1, '88323f7283bbdbce299a9c78cac6edfd', 0, NULL);
INSERT INTO "public"."lc_person" VALUES ('1', 'ty', '2879823308@qq.com', '902ef683c3f1726f1093275dfd1b3dd8', 1, 0, '127.0.0.1   ', '2023-07-13 16:24:38', NULL, 2, '93c174669ddb620b4808a97fcb32949e', 0, NULL);

-- ----------------------------
-- Table structure for lc_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."lc_role";
CREATE TABLE "public"."lc_role" (
  "id" int4 NOT NULL DEFAULT nextval('lc_role_id_seq'::regclass),
  "role_name" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "menu_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "interface_id" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6),
  "update_time" timestamp(6),
  "role_name_str" varchar(16) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."lc_role"."role_name_str" IS '中文，展示用';
COMMENT ON TABLE "public"."lc_role" IS '角色表';

-- ----------------------------
-- Records of lc_role
-- ----------------------------
INSERT INTO "public"."lc_role" VALUES (1, 'user', '1,2', '1', '2023-07-19 17:43:03', '2023-07-19 17:43:06', '用户');
INSERT INTO "public"."lc_role" VALUES (2, 'admin', '2', '1,2', NULL, NULL, '管理员');

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."lc_interface_id_seq"
OWNED BY "public"."lc_interface"."id";
SELECT setval('"public"."lc_interface_id_seq"', 1, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."lc_menu_id_seq"
OWNED BY "public"."lc_menu"."id";
SELECT setval('"public"."lc_menu_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."lc_role_id_seq"
OWNED BY "public"."lc_role"."id";
SELECT setval('"public"."lc_role_id_seq"', 1, false);

-- ----------------------------
-- Primary Key structure for table lc_interface
-- ----------------------------
ALTER TABLE "public"."lc_interface" ADD CONSTRAINT "lc_interface_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table lc_menu
-- ----------------------------
ALTER TABLE "public"."lc_menu" ADD CONSTRAINT "lc_menu_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table lc_person
-- ----------------------------
ALTER TABLE "public"."lc_person" ADD CONSTRAINT "lc_person_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table lc_role
-- ----------------------------
ALTER TABLE "public"."lc_role" ADD CONSTRAINT "lc_role_pkey" PRIMARY KEY ("id");
