-- ----------------------------
-- Sequence structure for tbl_sys_log_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."tbl_sys_log_id_seq";
CREATE SEQUENCE "public"."tbl_sys_log_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "public"."tbl_sys_log_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for tbl_website_access_record_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."tbl_website_access_record_id_seq";
CREATE SEQUENCE "public"."tbl_website_access_record_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "public"."tbl_website_access_record_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for tbl_website_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."tbl_website_id_seq";
CREATE SEQUENCE "public"."tbl_website_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."tbl_website_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Table structure for tbl_sys_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."tbl_sys_log";
CREATE TABLE "public"."tbl_sys_log" (
  "id" int4 NOT NULL DEFAULT nextval('tbl_sys_log_id_seq'::regclass),
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "operator" varchar(255) COLLATE "pg_catalog"."default",
  "operator_uid" int4,
  "content" text COLLATE "pg_catalog"."default",
  "method" varchar(255) COLLATE "pg_catalog"."default",
  "create_time" timestamp(6) DEFAULT now(),
  "ip" varchar(255) COLLATE "pg_catalog"."default",
  "params" text COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."tbl_sys_log" OWNER TO "postgres";
COMMENT ON COLUMN "public"."tbl_sys_log"."id" IS '主键';
COMMENT ON COLUMN "public"."tbl_sys_log"."type" IS '日志类型';
COMMENT ON COLUMN "public"."tbl_sys_log"."operator" IS '操作人';
COMMENT ON COLUMN "public"."tbl_sys_log"."operator_uid" IS '操作人用户id';
COMMENT ON COLUMN "public"."tbl_sys_log"."content" IS '日志内容';
COMMENT ON COLUMN "public"."tbl_sys_log"."method" IS '操作接口';
COMMENT ON COLUMN "public"."tbl_sys_log"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."tbl_sys_log"."ip" IS 'ip地址';
COMMENT ON COLUMN "public"."tbl_sys_log"."params" IS '参数';
COMMENT ON TABLE "public"."tbl_sys_log" IS '系统日志';

-- ----------------------------
-- Table structure for tbl_website
-- ----------------------------
DROP TABLE IF EXISTS "public"."tbl_website";
CREATE TABLE "public"."tbl_website" (
  "id" int4 NOT NULL DEFAULT nextval('tbl_website_id_seq'::regclass),
  "key" varchar(255) COLLATE "pg_catalog"."default",
  "website_name" varchar(255) COLLATE "pg_catalog"."default",
  "website_url" varchar(255) COLLATE "pg_catalog"."default",
  "icon_url" varchar(255) COLLATE "pg_catalog"."default",
  "is_main" bool NOT NULL DEFAULT false,
  "create_time" timestamp(6) DEFAULT now(),
  "update_time" timestamp(6) DEFAULT now()
)
;
ALTER TABLE "public"."tbl_website" OWNER TO "postgres";
COMMENT ON COLUMN "public"."tbl_website"."id" IS '主键';
COMMENT ON COLUMN "public"."tbl_website"."key" IS '网站key';
COMMENT ON COLUMN "public"."tbl_website"."website_name" IS '网站名称';
COMMENT ON COLUMN "public"."tbl_website"."website_url" IS '网站链接';
COMMENT ON COLUMN "public"."tbl_website"."icon_url" IS '网站图标';
COMMENT ON COLUMN "public"."tbl_website"."is_main" IS '当前系统标志';
COMMENT ON COLUMN "public"."tbl_website"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."tbl_website"."update_time" IS '更新时间';
COMMENT ON TABLE "public"."tbl_website" IS '站点信息';

-- ----------------------------
-- Table structure for tbl_website_access_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."tbl_website_access_record";
CREATE TABLE "public"."tbl_website_access_record" (
  "id" int8 NOT NULL DEFAULT nextval('tbl_website_access_record_id_seq'::regclass),
  "website_key" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "url" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "visitor_uid" int4 NOT NULL,
  "visitor_name" varchar(255) COLLATE "pg_catalog"."default",
  "ip" varchar(255) COLLATE "pg_catalog"."default",
  "error_msg" text COLLATE "pg_catalog"."default",
  "type" int2 NOT NULL,
  "create_time" timestamp(6) DEFAULT now(),
  "update_time" timestamp(6) DEFAULT now()
)
;
ALTER TABLE "public"."tbl_website_access_record" OWNER TO "postgres";
COMMENT ON COLUMN "public"."tbl_website_access_record"."id" IS '主键';
COMMENT ON COLUMN "public"."tbl_website_access_record"."website_key" IS '网站key';
COMMENT ON COLUMN "public"."tbl_website_access_record"."url" IS '访问界面地址';
COMMENT ON COLUMN "public"."tbl_website_access_record"."visitor_uid" IS '访问者ID';
COMMENT ON COLUMN "public"."tbl_website_access_record"."visitor_name" IS '访问者用户名';
COMMENT ON COLUMN "public"."tbl_website_access_record"."ip" IS 'IP地址';
COMMENT ON COLUMN "public"."tbl_website_access_record"."error_msg" IS '错误信息';
COMMENT ON COLUMN "public"."tbl_website_access_record"."type" IS '类型 0-pv/uv、1-错误信息';
COMMENT ON COLUMN "public"."tbl_website_access_record"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."tbl_website_access_record"."update_time" IS '更新时间';
COMMENT ON TABLE "public"."tbl_website_access_record" IS '站点访问记录';

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."tbl_sys_log_id_seq"
OWNED BY "public"."tbl_sys_log"."id";
SELECT setval('"public"."tbl_sys_log_id_seq"', 100, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."tbl_website_access_record_id_seq"
OWNED BY "public"."tbl_website_access_record"."id";
SELECT setval('"public"."tbl_website_access_record_id_seq"', 3755, true);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."tbl_website_id_seq"
OWNED BY "public"."tbl_website"."id";
SELECT setval('"public"."tbl_website_id_seq"', 3, true);

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

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

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