johnnyzhang1992 / xuegushi

一个关于古诗词的网站(包含小程序后端代码)
https://gushi.johnnyzhang.cn
MIT License
14 stars 3 forks source link

网站需要的表结构 #1

Open johnnyzhang1992 opened 5 years ago

johnnyzhang1992 commented 5 years ago

-- -- PostgreSQL database dump

SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET client_min_messages = warning;

SET default_tablespace = '';

SET default_with_oids = false;

-- -- Name: backups; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.backups ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, file_name character varying(250) DEFAULT ''::character varying NOT NULL, backup_size character varying(10) DEFAULT ''::character varying NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.backups OWNER TO postgres;

-- -- Name: backups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.backups_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.backups_id_seq OWNER TO postgres;

-- -- Name: backups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.backups_id_seq OWNED BY public.backups.id;

-- -- Name: departments; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.departments ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, tags character varying(1000) DEFAULT '[]'::character varying NOT NULL, color character varying(50) DEFAULT ''::character varying NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.departments OWNER TO postgres;

-- -- Name: departments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.departments_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.departments_id_seq OWNER TO postgres;

-- -- Name: departments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.departments_id_seq OWNED BY public.departments.id;

-- -- Name: dev_author_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_author_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_author_id_seq OWNER TO postgres;

-- -- Name: dev_author; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_author ( id integer DEFAULT nextval('public.dev_author_id_seq'::regclass) NOT NULL, source_id integer NOT NULL, dynasty character varying(128) NOT NULL, author_name character varying(128) NOT NULL, like_count integer DEFAULT 0, profile text, more_infos json, created_at timestamp without time zone, updated_at timestamp without time zone, collect_count integer DEFAULT 0, pv_count integer DEFAULT 0 );

ALTER TABLE public.dev_author OWNER TO postgres;

-- -- Name: TABLE dev_author; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_author IS '诗人表';

-- -- Name: COLUMN dev_author.collect_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_author.collect_count IS '收藏数量';

-- -- Name: COLUMN dev_author.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_author.pv_count IS '访问量统计';

-- -- Name: dev_book_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_book_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_book_id_seq OWNER TO postgres;

-- -- Name: dev_book; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_book ( id integer DEFAULT nextval('public.dev_book_id_seq'::regclass) NOT NULL, book_name character varying(255) NOT NULL, title character varying(255) NOT NULL, content text NOT NULL, book_id integer );

ALTER TABLE public.dev_book OWNER TO postgres;

-- -- Name: TABLE dev_book; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_book IS '小说表';

-- -- Name: dev_book_list_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_book_list_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_book_list_id_seq OWNER TO postgres;

-- -- Name: dev_book_list; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_book_list ( id integer DEFAULT nextval('public.dev_book_list_id_seq'::regclass) NOT NULL, name character varying(255) NOT NULL, author character varying(255) NOT NULL, profile text NOT NULL, type character varying(128) );

ALTER TABLE public.dev_book_list OWNER TO postgres;

-- -- Name: TABLE dev_book_list; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_book_list IS '小说列表';

-- -- Name: dev_collect_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_collect_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_collect_id_seq OWNER TO postgres;

-- -- Name: dev_collect; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_collect ( id integer DEFAULT nextval('public.dev_collect_id_seq'::regclass) NOT NULL, user_id integer, like_id integer, type character varying(128), status character varying(128), created_at timestamp without time zone, updated_at timestamp without time zone, ip character varying(128) );

ALTER TABLE public.dev_collect OWNER TO postgres;

-- -- Name: TABLE dev_collect; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_collect IS '诗文和作者收藏记录表';

-- -- Name: COLUMN dev_collect.ip; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_collect.ip IS 'ip地址';

-- -- Name: dev_like_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_like_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_like_id_seq OWNER TO postgres;

-- -- Name: dev_like; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_like ( id integer DEFAULT nextval('public.dev_like_id_seq'::regclass) NOT NULL, type character varying(128) NOT NULL, user_id integer DEFAULT 0 NOT NULL, like_id integer, created_at timestamp without time zone, updated_at timestamp without time zone, status character varying(128), ip character varying(128) );

ALTER TABLE public.dev_like OWNER TO postgres;

-- -- Name: TABLE dev_like; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_like IS '点赞记录表';

-- -- Name: COLUMN dev_like.user_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_like.user_id IS '用户id';

-- -- Name: COLUMN dev_like.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_like.status IS 'active,delete';

-- -- Name: COLUMN dev_like.ip; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_like.ip IS 'ip地址';

-- -- Name: dev_mingju_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_mingju_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_mingju_id_seq OWNER TO postgres;

-- -- Name: dev_pages_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_pages_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_pages_id_seq OWNER TO postgres;

-- -- Name: dev_pages; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_pages ( id integer DEFAULT nextval('public.dev_pages_id_seq'::regclass) NOT NULL, creator_id integer NOT NULL, name character varying(64), display_name character varying(128), tags character varying(64), content text, html_content text, pv_count integer DEFAULT 0, like_count integer DEFAULT 0, collect_count integer DEFAULT 0, created_at timestamp without time zone, updated_at timestamp without time zone, deleted_at timestamp without time zone, editor_id integer );

ALTER TABLE public.dev_pages OWNER TO postgres;

-- -- Name: TABLE dev_pages; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_pages IS '专题页面';

-- -- Name: COLUMN dev_pages.creator_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.creator_id IS '创建者id';

-- -- Name: COLUMN dev_pages.name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.name IS '自定义链接';

-- -- Name: COLUMN dev_pages.display_name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.display_name IS '标题';

-- -- Name: COLUMN dev_pages.tags; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.tags IS '标签';

-- -- Name: COLUMN dev_pages.content; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.content IS '内容';

-- -- Name: COLUMN dev_pages.html_content; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.html_content IS 'html内容';

-- -- Name: COLUMN dev_pages.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.pv_count IS '浏览量';

-- -- Name: COLUMN dev_pages.like_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.like_count IS '喜欢';

-- -- Name: COLUMN dev_pages.collect_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.collect_count IS '收藏';

-- -- Name: COLUMN dev_pages.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.created_at IS '创建时间';

-- -- Name: COLUMN dev_pages.updated_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.updated_at IS '更新时间';

-- -- Name: COLUMN dev_pages.deleted_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.deleted_at IS '删除时间';

-- -- Name: COLUMN dev_pages.editor_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pages.editor_id IS '编辑者id';

-- -- Name: dev_photo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_photo_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_photo_id_seq OWNER TO postgres;

-- -- Name: dev_photo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_photo ( id integer DEFAULT nextval('public.dev_photo_id_seq'::regclass) NOT NULL, name character varying(128) NOT NULL, extension character varying(64), type_id integer, type character varying(64), uid integer NOT NULL, source_url character varying(255) NOT NULL, info character varying(255), created_at timestamp without time zone, updated_at timestamp without time zone, deleted_at timestamp without time zone );

ALTER TABLE public.dev_photo OWNER TO postgres;

-- -- Name: TABLE dev_photo; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_photo IS '上传图片记录表';

-- -- Name: COLUMN dev_photo.name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.name IS '图片名字';

-- -- Name: COLUMN dev_photo.extension; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.extension IS '图片拓展类型';

-- -- Name: COLUMN dev_photo.type_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.type_id IS '图片指向网页类型id';

-- -- Name: COLUMN dev_photo.type; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.type IS '网页类型';

-- -- Name: COLUMN dev_photo.uid; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.uid IS '用户id';

-- -- Name: COLUMN dev_photo.source_url; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.source_url IS '图片地址';

-- -- Name: COLUMN dev_photo.info; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_photo.info IS '备注信息';

-- -- Name: dev_pin_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_pin_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_pin_id_seq OWNER TO postgres;

-- -- Name: dev_pin; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_pin ( id integer DEFAULT nextval('public.dev_pin_id_seq'::regclass) NOT NULL, u_id integer NOT NULL, t_id integer, t_type character varying(32), p_id integer, content text, status character varying(32), created_at timestamp without time zone, updated_at timestamp without time zone, like_count integer DEFAULT 0, location json, flag integer DEFAULT 0 );

ALTER TABLE public.dev_pin OWNER TO postgres;

-- -- Name: TABLE dev_pin; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_pin IS '想法';

-- -- Name: COLUMN dev_pin.u_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.u_id IS '用户id';

-- -- Name: COLUMN dev_pin.t_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.t_id IS '目标id';

-- -- Name: COLUMN dev_pin.t_type; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.t_type IS '目标类型,poem、poet';

-- -- Name: COLUMN dev_pin.p_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.p_id IS '父id';

-- -- Name: COLUMN dev_pin.content; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.content IS '内容';

-- -- Name: COLUMN dev_pin.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.status IS '状态,active,delete';

-- -- Name: COLUMN dev_pin.like_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.like_count IS '点赞数';

-- -- Name: COLUMN dev_pin.location; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_pin.location IS '位置信息';

-- -- Name: dev_poem_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_poem_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_poem_id_seq OWNER TO postgres;

-- -- Name: dev_poem; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_poem ( id integer DEFAULT nextval('public.dev_poem_id_seq'::regclass) NOT NULL, source_id integer NOT NULL, title character varying(128) NOT NULL, author character varying(128) NOT NULL, dynasty character varying(128) NOT NULL, tags character varying(255), content json, background text, created_at timestamp without time zone, updated_at timestamp without time zone, type character varying(128), like_count integer DEFAULT 0, author_source_id integer, author_id integer, collect_count integer DEFAULT 0, pv_count integer DEFAULT 0, text_content text, is_text boolean DEFAULT false );

ALTER TABLE public.dev_poem OWNER TO postgres;

-- -- Name: TABLE dev_poem; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_poem IS '诗词表';

-- -- Name: COLUMN dev_poem.author_source_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_poem.author_source_id IS '作者的资源id,-1表示作者未知';

-- -- Name: COLUMN dev_poem.author_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_poem.author_id IS '作者id';

-- -- Name: COLUMN dev_poem.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_poem.pv_count IS '浏览量统计';

-- -- Name: dev_poem_author_source_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_poem_author_source_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_poem_author_source_id_seq OWNER TO postgres;

-- -- Name: dev_poem_author_source_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.dev_poem_author_source_id_seq OWNED BY public.dev_poem.author_source_id;

-- -- Name: poem_book_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.poem_book_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.poem_book_id_seq OWNER TO postgres;

-- -- Name: dev_poem_book; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_poem_book ( id integer DEFAULT nextval('public.poem_book_id_seq'::regclass) NOT NULL, source_id integer NOT NULL, title character varying(255), book character varying(255), belong character varying(255), belong_name character varying(64) );

ALTER TABLE public.dev_poem_book OWNER TO postgres;

-- -- Name: TABLE dev_poem_book; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_poem_book IS 'poem整理,详细分类';

-- -- Name: dev_poem_detail; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_poem_detail ( id integer NOT NULL, poem_id integer NOT NULL, source_id integer NOT NULL, poem_title character varying(128) NOT NULL, poem_type character varying(128) NOT NULL, like_count integer DEFAULT 0 NOT NULL, yi json, zhu json, shangxi json, more_infos json, created_at timestamp without time zone, updated_at timestamp without time zone );

ALTER TABLE public.dev_poem_detail OWNER TO postgres;

-- -- Name: TABLE dev_poem_detail; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_poem_detail IS '诗词文详情表';

-- -- Name: dev_poem_detail_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_poem_detail_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_poem_detail_id_seq OWNER TO postgres;

-- -- Name: dev_post_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_post_id_seq START WITH 20180000 INCREMENT BY 1 MINVALUE 20180000 NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_post_id_seq OWNER TO postgres;

-- -- Name: dev_post; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_post ( id integer DEFAULT nextval('public.dev_post_id_seq'::regclass) NOT NULL, creator_id integer NOT NULL, title character varying(128) NOT NULL, topic character varying, content text NOT NULL, collect_count integer DEFAULT 0, pv_count integer DEFAULT 0, created_at timestamp without time zone, updated_at timestamp without time zone, status character varying(64), zhuanlan_id integer, cover_url character varying(255), like_count integer DEFAULT 0 );

ALTER TABLE public.dev_post OWNER TO postgres;

-- -- Name: TABLE dev_post; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_post IS '文章表';

-- -- Name: COLUMN dev_post.creator_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.creator_id IS '作者id';

-- -- Name: COLUMN dev_post.title; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.title IS '标题';

-- -- Name: COLUMN dev_post.topic; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.topic IS '话题';

-- -- Name: COLUMN dev_post.content; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.content IS '内容';

-- -- Name: COLUMN dev_post.collect_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.collect_count IS '收藏';

-- -- Name: COLUMN dev_post.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.pv_count IS '浏览量';

-- -- Name: COLUMN dev_post.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.status IS '状态,draft 草稿suspend冻结 active正常 delete删除';

-- -- Name: COLUMN dev_post.zhuanlan_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.zhuanlan_id IS '专栏id,可为空';

-- -- Name: COLUMN dev_post.cover_url; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post.cover_url IS '封面图地址';

-- -- Name: dev_post_relation_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_post_relation_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_post_relation_id_seq OWNER TO postgres;

-- -- Name: dev_post_relation; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_post_relation ( id integer DEFAULT nextval('public.dev_post_relation_id_seq'::regclass) NOT NULL, post_id integer NOT NULL, zhuanlan_id integer, creator_id integer NOT NULL, created_at timestamp without time zone DEFAULT now() );

ALTER TABLE public.dev_post_relation OWNER TO postgres;

-- -- Name: TABLE dev_post_relation; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_post_relation IS '文章/专栏/作者关系表,同一篇文章可能属于多个专栏';

-- -- Name: COLUMN dev_post_relation.post_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post_relation.post_id IS '文章id';

-- -- Name: COLUMN dev_post_relation.zhuanlan_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post_relation.zhuanlan_id IS '专栏id,可以为空';

-- -- Name: COLUMN dev_post_relation.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_post_relation.created_at IS '关联时间';

-- -- Name: dev_review_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_review_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_review_id_seq OWNER TO postgres;

-- -- Name: dev_review; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_review ( id integer DEFAULT nextval('public.dev_review_id_seq'::regclass) NOT NULL, u_id integer NOT NULL, t_id integer NOT NULL, t_type character varying NOT NULL, content text, status character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone, parent_id integer );

ALTER TABLE public.dev_review OWNER TO postgres;

-- -- Name: TABLE dev_review; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_review IS '评论表';

-- -- Name: COLUMN dev_review.u_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.u_id IS '用户id';

-- -- Name: COLUMN dev_review.t_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.t_id IS '指向内容id';

-- -- Name: COLUMN dev_review.t_type; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.t_type IS '内容类型';

-- -- Name: COLUMN dev_review.content; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.content IS '评论内容';

-- -- Name: COLUMN dev_review.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.status IS '状态/自己和管理员可以删除';

-- -- Name: COLUMN dev_review.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.created_at IS '创建时间';

-- -- Name: COLUMN dev_review.updated_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.updated_at IS '更新时间';

-- -- Name: COLUMN dev_review.parent_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_review.parent_id IS '父id,回复的原评论id,初始未null';

-- -- Name: dev_search_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_search_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_search_id_seq OWNER TO postgres;

-- -- Name: dev_search; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_search ( id integer DEFAULT nextval('public.dev_search_id_seq'::regclass) NOT NULL, name character varying(255) NOT NULL, created_at timestamp without time zone, count integer DEFAULT 0, status character varying(255) );

ALTER TABLE public.dev_search OWNER TO postgres;

-- -- Name: TABLE dev_search; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_search IS '搜索记录表';

-- -- Name: COLUMN dev_search.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_search.status IS '状态';

-- -- Name: dev_sentence; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_sentence ( id integer DEFAULT nextval('public.dev_mingju_id_seq'::regclass) NOT NULL, source_id integer NOT NULL, target_source_id integer NOT NULL, title character varying(128), theme character varying(64), type character varying(255), origin character varying(128), like_count integer DEFAULT 0, content text, created_at timestamp without time zone, updated_at timestamp without time zone, deleted_at timestamp without time zone, collect_count integer DEFAULT 0, pv_count integer DEFAULT 0 );

ALTER TABLE public.dev_sentence OWNER TO postgres;

-- -- Name: TABLE dev_sentence; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_sentence IS '名句表';

-- -- Name: COLUMN dev_sentence.source_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.source_id IS '原网站id';

-- -- Name: COLUMN dev_sentence.target_source_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.target_source_id IS '原网站诗文id';

-- -- Name: COLUMN dev_sentence.title; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.title IS '标题';

-- -- Name: COLUMN dev_sentence.theme; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.theme IS '主题';

-- -- Name: COLUMN dev_sentence.type; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.type IS '分类';

-- -- Name: COLUMN dev_sentence.origin; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.origin IS '来源,比如苏轼 水调歌头';

-- -- Name: COLUMN dev_sentence.like_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.like_count IS '喜欢数量';

-- -- Name: COLUMN dev_sentence.content; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.content IS '内容';

-- -- Name: COLUMN dev_sentence.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_sentence.pv_count IS '浏览量统计';

-- -- Name: dev_topic_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_topic_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_topic_id_seq OWNER TO postgres;

-- -- Name: dev_topic; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_topic ( id integer DEFAULT nextval('public.dev_topic_id_seq'::regclass) NOT NULL, name character varying NOT NULL, created_at timestamp without time zone );

ALTER TABLE public.dev_topic OWNER TO postgres;

-- -- Name: TABLE dev_topic; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_topic IS '话题表';

-- -- Name: COLUMN dev_topic.name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_topic.name IS '中文名';

-- -- Name: COLUMN dev_topic.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_topic.created_at IS '创建时间';

-- -- Name: dev_wx_topic_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_wx_topic_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_wx_topic_id_seq OWNER TO postgres;

-- -- Name: dev_wx_topic; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_wx_topic ( id integer DEFAULT nextval('public.dev_wx_topic_id_seq'::regclass) NOT NULL, name character varying(128) NOT NULL, description text, status character varying(32) NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone );

ALTER TABLE public.dev_wx_topic OWNER TO postgres;

-- -- Name: TABLE dev_wx_topic; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_wx_topic IS '小程序话题列表';

-- -- Name: dev_wx_users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_wx_users_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_wx_users_id_seq OWNER TO postgres;

-- -- Name: dev_wx_users; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_wx_users ( id integer DEFAULT nextval('public.dev_wx_users_id_seq'::regclass) NOT NULL, user_id integer, name character varying(255), "openId" character varying(255), wx_openid character varying(255), gender integer, city character(255), province character varying(255), country character varying(255), language character varying(255), "avatarUrl" text, "systemInfo" json, more_infos json, created_at timestamp without time zone, updated_at timestamp without time zone, "timestamp" character varying(10) );

ALTER TABLE public.dev_wx_users OWNER TO postgres;

-- -- Name: TABLE dev_wx_users; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_wx_users IS '微信小程序用户表';

-- -- Name: COLUMN dev_wx_users.user_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.user_id IS '关联pc上的用户表';

-- -- Name: COLUMN dev_wx_users.name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.name IS '昵称';

-- -- Name: COLUMN dev_wx_users."openId"; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users."openId" IS '用户的openId';

-- -- Name: COLUMN dev_wx_users.wx_openid; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.wx_openid IS '小程序的openid';

-- -- Name: COLUMN dev_wx_users.gender; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.gender IS '性别(0:女,1:男';

-- -- Name: COLUMN dev_wx_users.city; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.city IS '城市';

-- -- Name: COLUMN dev_wx_users.province; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.province IS '省份';

-- -- Name: COLUMN dev_wx_users.country; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.country IS '国家';

-- -- Name: COLUMN dev_wx_users.language; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.language IS '语言';

-- -- Name: COLUMN dev_wx_users."avatarUrl"; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users."avatarUrl" IS '头像';

-- -- Name: COLUMN dev_wx_users."systemInfo"; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users."systemInfo" IS '手机系统信息';

-- -- Name: COLUMN dev_wx_users.more_infos; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.more_infos IS '更多信息';

-- -- Name: COLUMN dev_wx_users.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.created_at IS '创建信息';

-- -- Name: COLUMN dev_wx_users.updated_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users.updated_at IS '更新时间';

-- -- Name: COLUMN dev_wx_users."timestamp"; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_wx_users."timestamp" IS '时间戳,js格式';

-- -- Name: dev_zhuanlan_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_zhuanlan_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_zhuanlan_id_seq OWNER TO postgres;

SET default_with_oids = true;

-- -- Name: dev_zhuanlan; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_zhuanlan ( id integer DEFAULT nextval('public.dev_zhuanlan_id_seq'::regclass) NOT NULL, name character varying(64) NOT NULL, about text, topic character varying(128) NOT NULL, creator_id integer NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, status character varying(64), alia_name character varying(128) NOT NULL, avatar character varying(255), specialty text, wechat character varying(64), verified boolean DEFAULT false NOT NULL, pv_count integer DEFAULT 0 );

ALTER TABLE public.dev_zhuanlan OWNER TO postgres;

-- -- Name: TABLE dev_zhuanlan; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_zhuanlan IS '专栏表';

-- -- Name: COLUMN dev_zhuanlan.name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.name IS '专栏名字';

-- -- Name: COLUMN dev_zhuanlan.about; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.about IS '关于';

-- -- Name: COLUMN dev_zhuanlan.topic; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.topic IS '话题,最少一个,不可为空';

-- -- Name: COLUMN dev_zhuanlan.creator_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.creator_id IS '创建者';

-- -- Name: COLUMN dev_zhuanlan.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.status IS '状态';

-- -- Name: COLUMN dev_zhuanlan.alia_name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.alia_name IS '专栏中文名字';

-- -- Name: COLUMN dev_zhuanlan.avatar; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.avatar IS '头像地址';

-- -- Name: COLUMN dev_zhuanlan.specialty; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.specialty IS '个人介绍';

-- -- Name: COLUMN dev_zhuanlan.wechat; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.wechat IS '微信';

-- -- Name: COLUMN dev_zhuanlan.verified; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.verified IS '是否审核通过';

-- -- Name: COLUMN dev_zhuanlan.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zhuanlan.pv_count IS '浏览量';

-- -- Name: dev_zl_follow_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.dev_zl_follow_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.dev_zl_follow_id_seq OWNER TO postgres;

SET default_with_oids = false;

-- -- Name: dev_zl_follow; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.dev_zl_follow ( id integer DEFAULT nextval('public.dev_zl_follow_id_seq'::regclass) NOT NULL, zl_id integer NOT NULL, u_id integer NOT NULL, status integer NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL );

ALTER TABLE public.dev_zl_follow OWNER TO postgres;

-- -- Name: TABLE dev_zl_follow; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.dev_zl_follow IS '专栏关注记录表';

-- -- Name: COLUMN dev_zl_follow.zl_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zl_follow.zl_id IS '专栏id';

-- -- Name: COLUMN dev_zl_follow.u_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zl_follow.u_id IS '用户id';

-- -- Name: COLUMN dev_zl_follow.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zl_follow.status IS '关注状态';

-- -- Name: COLUMN dev_zl_follow.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zl_follow.created_at IS '创建时间';

-- -- Name: COLUMN dev_zl_follow.updated_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.dev_zl_follow.updated_at IS '更新时间';

-- -- Name: employees; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.employees ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, designation character varying(50) DEFAULT ''::character varying NOT NULL, gender character varying(255) DEFAULT 'Male'::character varying NOT NULL, mobile character varying(20) DEFAULT ''::character varying NOT NULL, mobile2 character varying(20) NOT NULL, email character varying(250) DEFAULT ''::character varying NOT NULL, dept integer DEFAULT 1 NOT NULL, city character varying(50) NOT NULL, address character varying(1000) NOT NULL, about character varying(255) NOT NULL, date_birth date DEFAULT '1990-01-01'::date NOT NULL, date_hire date NOT NULL, date_left date DEFAULT '1990-01-01'::date NOT NULL, salary_cur numeric(15,3) DEFAULT 0.0 NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.employees OWNER TO postgres;

-- -- Name: employees_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.employees_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.employees_id_seq OWNER TO postgres;

-- -- Name: employees_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.employees_id_seq OWNED BY public.employees.id;

-- -- Name: la_configs; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.la_configs ( id integer NOT NULL, key character varying(50) NOT NULL, section character varying(100) DEFAULT ''::character varying NOT NULL, value character varying(255) NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.la_configs OWNER TO postgres;

-- -- Name: la_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.la_configs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.la_configs_id_seq OWNER TO postgres;

-- -- Name: la_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.la_configs_id_seq OWNED BY public.la_configs.id;

-- -- Name: la_menus; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.la_menus ( id integer NOT NULL, name character varying(50) NOT NULL, url character varying(256) NOT NULL, icon character varying(50) DEFAULT 'fa-cube'::character varying NOT NULL, type character varying(20) DEFAULT 'module'::character varying NOT NULL, parent integer DEFAULT 0 NOT NULL, hierarchy integer DEFAULT 0 NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.la_menus OWNER TO postgres;

-- -- Name: la_menus_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.la_menus_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.la_menus_id_seq OWNER TO postgres;

-- -- Name: la_menus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.la_menus_id_seq OWNED BY public.la_menus.id;

-- -- Name: migrations; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.migrations ( migration character varying(255) NOT NULL, batch integer NOT NULL );

ALTER TABLE public.migrations OWNER TO postgres;

-- -- Name: module_field_types; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.module_field_types ( id integer NOT NULL, name character varying(30) NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.module_field_types OWNER TO postgres;

-- -- Name: module_field_types_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.module_field_types_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.module_field_types_id_seq OWNER TO postgres;

-- -- Name: module_field_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.module_field_types_id_seq OWNED BY public.module_field_types.id;

-- -- Name: module_fields; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.module_fields ( id integer NOT NULL, colname character varying(30) NOT NULL, label character varying(100) NOT NULL, module integer NOT NULL, field_type integer NOT NULL, "unique" boolean DEFAULT false NOT NULL, defaultvalue character varying(255) NOT NULL, minlength integer DEFAULT 0 NOT NULL, maxlength integer DEFAULT 0 NOT NULL, required boolean DEFAULT false NOT NULL, popup_vals text NOT NULL, sort integer DEFAULT 0 NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.module_fields OWNER TO postgres;

-- -- Name: module_fields_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.module_fields_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.module_fields_id_seq OWNER TO postgres;

-- -- Name: module_fields_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.module_fields_id_seq OWNED BY public.module_fields.id;

-- -- Name: modules; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.modules ( id integer NOT NULL, name character varying(50) NOT NULL, label character varying(100) NOT NULL, name_db character varying(50) NOT NULL, view_col character varying(50) NOT NULL, model character varying(50) NOT NULL, controller character varying(100) NOT NULL, fa_icon character varying(30) DEFAULT 'fa-cube'::character varying NOT NULL, is_gen boolean NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.modules OWNER TO postgres;

-- -- Name: modules_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.modules_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.modules_id_seq OWNER TO postgres;

-- -- Name: modules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.modules_id_seq OWNED BY public.modules.id;

-- -- Name: organizations; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.organizations ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, email character varying(250) NOT NULL, phone character varying(20) NOT NULL, website character varying(250) DEFAULT 'http://'::character varying NOT NULL, assigned_to integer DEFAULT 1 NOT NULL, connect_since date NOT NULL, address character varying(1000) DEFAULT ''::character varying NOT NULL, city character varying(250) DEFAULT ''::character varying NOT NULL, description character varying(1000) NOT NULL, profile_image integer NOT NULL, profile integer NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.organizations OWNER TO postgres;

-- -- Name: organizations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.organizations_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.organizations_id_seq OWNER TO postgres;

-- -- Name: organizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.organizations_id_seq OWNED BY public.organizations.id;

-- -- Name: password_resets; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.password_resets ( email character varying(255) NOT NULL, token character varying(255) NOT NULL, created_at timestamp(0) without time zone );

ALTER TABLE public.password_resets OWNER TO postgres;

-- -- Name: permission_role; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.permission_role ( permission_id integer NOT NULL, role_id integer NOT NULL );

ALTER TABLE public.permission_role OWNER TO postgres;

-- -- Name: permissions; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.permissions ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, display_name character varying(250) DEFAULT ''::character varying NOT NULL, description character varying(1000) NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.permissions OWNER TO postgres;

-- -- Name: permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.permissions_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.permissions_id_seq OWNER TO postgres;

-- -- Name: permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.permissions_id_seq OWNED BY public.permissions.id;

-- -- Name: poem_dynasty_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.poem_dynasty_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.poem_dynasty_id_seq OWNER TO postgres;

-- -- Name: poem_dynasty; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.poem_dynasty ( id integer DEFAULT nextval('public.poem_dynasty_id_seq'::regclass) NOT NULL, name character varying(128), alia_name character varying(128), count integer DEFAULT 0 );

ALTER TABLE public.poem_dynasty OWNER TO postgres;

-- -- Name: TABLE poem_dynasty; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.poem_dynasty IS '古诗朝代表';

-- -- Name: poem_type_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.poem_type_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.poem_type_id_seq OWNER TO postgres;

-- -- Name: poem_type; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.poem_type ( id integer DEFAULT nextval('public.poem_type_id_seq'::regclass) NOT NULL, name character varying(128) NOT NULL, alia_name character varying(128) NOT NULL, count integer DEFAULT 0 );

ALTER TABLE public.poem_type OWNER TO postgres;

-- -- Name: TABLE poem_type; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.poem_type IS '古诗类型表:诗词曲赋文言文';

-- -- Name: role_module; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.role_module ( id integer NOT NULL, role_id integer NOT NULL, module_id integer NOT NULL, acc_view boolean NOT NULL, acc_create boolean NOT NULL, acc_edit boolean NOT NULL, acc_delete boolean NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.role_module OWNER TO postgres;

-- -- Name: role_module_fields; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.role_module_fields ( id integer NOT NULL, role_id integer NOT NULL, field_id integer NOT NULL, access character varying(255) NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone, CONSTRAINT role_module_fields_access_check CHECK (((access)::text = ANY ((ARRAY['invisible'::character varying, 'readonly'::character varying, 'write'::character varying])::text[]))) );

ALTER TABLE public.role_module_fields OWNER TO postgres;

-- -- Name: role_module_fields_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.role_module_fields_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.role_module_fields_id_seq OWNER TO postgres;

-- -- Name: role_module_fields_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.role_module_fields_id_seq OWNED BY public.role_module_fields.id;

-- -- Name: role_module_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.role_module_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.role_module_id_seq OWNER TO postgres;

-- -- Name: role_module_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.role_module_id_seq OWNED BY public.role_module.id;

-- -- Name: role_user; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.role_user ( id integer NOT NULL, role_id integer NOT NULL, user_id integer NOT NULL, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.role_user OWNER TO postgres;

-- -- Name: role_user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.role_user_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.role_user_id_seq OWNER TO postgres;

-- -- Name: role_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.role_user_id_seq OWNED BY public.role_user.id;

-- -- Name: roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.roles ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, display_name character varying(250) DEFAULT ''::character varying NOT NULL, description character varying(1000) NOT NULL, parent integer DEFAULT 1 NOT NULL, dept integer DEFAULT 1 NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.roles OWNER TO postgres;

-- -- Name: roles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.roles_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.roles_id_seq OWNER TO postgres;

-- -- Name: roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.roles_id_seq OWNED BY public.roles.id;

-- -- Name: uploads; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.uploads ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, path character varying(250) NOT NULL, extension character varying(20) NOT NULL, caption character varying(250) NOT NULL, user_id integer DEFAULT 1 NOT NULL, hash character varying(250) NOT NULL, public boolean DEFAULT false NOT NULL, deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone );

ALTER TABLE public.uploads OWNER TO postgres;

-- -- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.uploads_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.uploads_id_seq OWNER TO postgres;

-- -- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.uploads_id_seq OWNED BY public.uploads.id;

-- -- Name: user_detail_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.user_detail_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.user_detail_id_seq OWNER TO postgres;

-- -- Name: user_detail; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.user_detail ( id integer DEFAULT nextval('public.user_detail_id_seq'::regclass) NOT NULL, user_id integer NOT NULL, name character varying(128), nick_name character varying(128), gender integer, email character varying(250), mobile character varying(11), country character varying(20), province character varying(20), city character varying(64), about character varying(250), date_birth date DEFAULT '1992-01-01'::date, deleted_at timestamp without time zone, created_at timestamp without time zone, updated_at timestamp without time zone, status character varying(128) );

ALTER TABLE public.user_detail OWNER TO postgres;

-- -- Name: TABLE user_detail; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON TABLE public.user_detail IS '用户详细信息表';

-- -- Name: COLUMN user_detail.user_id; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.user_id IS '关联user表';

-- -- Name: COLUMN user_detail.name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.name IS '注册是填写的';

-- -- Name: COLUMN user_detail.nick_name; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.nick_name IS '昵称';

-- -- Name: COLUMN user_detail.gender; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.gender IS '性别,0女性,1男性,2其它';

-- -- Name: COLUMN user_detail.email; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.email IS '邮箱';

-- -- Name: COLUMN user_detail.mobile; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.mobile IS '手机号';

-- -- Name: COLUMN user_detail.country; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.country IS '国家';

-- -- Name: COLUMN user_detail.province; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.province IS '省份';

-- -- Name: COLUMN user_detail.city; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.city IS '城市';

-- -- Name: COLUMN user_detail.about; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.about IS '详细地址';

-- -- Name: COLUMN user_detail.date_birth; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.date_birth IS '出生入秋';

-- -- Name: COLUMN user_detail.deleted_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.deleted_at IS '注销日期';

-- -- Name: COLUMN user_detail.created_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.created_at IS '注册日期';

-- -- Name: COLUMN user_detail.updated_at; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.updated_at IS '最后一次登录日期';

-- -- Name: COLUMN user_detail.status; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.user_detail.status IS '账号状态,active正常,pedding冻结,delete注销';

-- -- Name: users; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

CREATE TABLE public.users ( id integer NOT NULL, name character varying(250) DEFAULT ''::character varying NOT NULL, context_id integer DEFAULT 0 NOT NULL, email character varying(250) NOT NULL, password character varying(250) DEFAULT ''::character varying NOT NULL, type character varying(255) DEFAULT 'Employee'::character varying NOT NULL, remember_token character varying(100), deleted_at timestamp(0) without time zone, created_at timestamp(0) without time zone, updated_at timestamp(0) without time zone, like_count integer DEFAULT 0 NOT NULL, collect_count integer DEFAULT 0 NOT NULL, last_login_ip character varying(128), avatar character varying(255) DEFAULT '/static/images/avatar.png'::character varying, about character varying(255), domain character varying(64), pv_count integer DEFAULT 0, openid character varying(255), wx_token character varying(255) );

ALTER TABLE public.users OWNER TO postgres;

-- -- Name: COLUMN users.like_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.like_count IS '喜欢数目';

-- -- Name: COLUMN users.collect_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.collect_count IS '收藏数量';

-- -- Name: COLUMN users.last_login_ip; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.last_login_ip IS '最后登录ip';

-- -- Name: COLUMN users.about; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.about IS '介绍(120字以内';

-- -- Name: COLUMN users.domain; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.domain IS '个性域名';

-- -- Name: COLUMN users.pv_count; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.pv_count IS '访问量';

-- -- Name: COLUMN users.openid; Type: COMMENT; Schema: public; Owner: postgres

COMMENT ON COLUMN public.users.openid IS '小程序用户openid';

-- -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres

CREATE SEQUENCE public.users_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

ALTER TABLE public.users_id_seq OWNER TO postgres;

-- -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.backups ALTER COLUMN id SET DEFAULT nextval('public.backups_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.departments ALTER COLUMN id SET DEFAULT nextval('public.departments_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.employees ALTER COLUMN id SET DEFAULT nextval('public.employees_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.la_configs ALTER COLUMN id SET DEFAULT nextval('public.la_configs_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.la_menus ALTER COLUMN id SET DEFAULT nextval('public.la_menus_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.module_field_types ALTER COLUMN id SET DEFAULT nextval('public.module_field_types_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.module_fields ALTER COLUMN id SET DEFAULT nextval('public.module_fields_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.modules ALTER COLUMN id SET DEFAULT nextval('public.modules_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.organizations ALTER COLUMN id SET DEFAULT nextval('public.organizations_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.permissions ALTER COLUMN id SET DEFAULT nextval('public.permissions_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_module ALTER COLUMN id SET DEFAULT nextval('public.role_module_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_module_fields ALTER COLUMN id SET DEFAULT nextval('public.role_module_fields_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_user ALTER COLUMN id SET DEFAULT nextval('public.role_user_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.roles ALTER COLUMN id SET DEFAULT nextval('public.roles_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.uploads ALTER COLUMN id SET DEFAULT nextval('public.uploads_id_seq'::regclass);

-- -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);

-- -- Name: backups_file_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.backups ADD CONSTRAINT backups_file_name_unique UNIQUE (file_name);

-- -- Name: backups_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.backups ADD CONSTRAINT backups_name_unique UNIQUE (name);

-- -- Name: backups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.backups ADD CONSTRAINT backups_pkey PRIMARY KEY (id);

-- -- Name: departments_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.departments ADD CONSTRAINT departments_name_unique UNIQUE (name);

-- -- Name: departments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.departments ADD CONSTRAINT departments_pkey PRIMARY KEY (id);

-- -- Name: dev_author_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_author ADD CONSTRAINT dev_author_pkey PRIMARY KEY (id);

-- -- Name: dev_author_source_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_author ADD CONSTRAINT dev_author_source_id_key UNIQUE (source_id);

-- -- Name: dev_book_list_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_book_list ADD CONSTRAINT dev_book_list_pkey PRIMARY KEY (id);

-- -- Name: dev_book_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_book ADD CONSTRAINT dev_book_pkey PRIMARY KEY (id);

-- -- Name: dev_collect_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_collect ADD CONSTRAINT dev_collect_id_key UNIQUE (id);

-- -- Name: dev_collect_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_collect ADD CONSTRAINT dev_collect_pkey PRIMARY KEY (id);

-- -- Name: dev_mingju_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_sentence ADD CONSTRAINT dev_mingju_pkey PRIMARY KEY (id);

-- -- Name: dev_pages_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_pages ADD CONSTRAINT dev_pages_name_key UNIQUE (name);

-- -- Name: dev_pages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_pages ADD CONSTRAINT dev_pages_pkey PRIMARY KEY (id);

-- -- Name: dev_photo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_photo ADD CONSTRAINT dev_photo_pkey PRIMARY KEY (id);

-- -- Name: dev_pin_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_pin ADD CONSTRAINT dev_pin_pkey PRIMARY KEY (id);

-- -- Name: dev_poem_detail_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_poem_detail ADD CONSTRAINT dev_poem_detail_pkey PRIMARY KEY (id);

-- -- Name: dev_poem_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_poem ADD CONSTRAINT dev_poem_pkey PRIMARY KEY (id);

-- -- Name: dev_post_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_post ADD CONSTRAINT dev_post_pkey PRIMARY KEY (id);

-- -- Name: dev_post_relation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_post_relation ADD CONSTRAINT dev_post_relation_pkey PRIMARY KEY (id);

-- -- Name: dev_review_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_review ADD CONSTRAINT dev_review_pkey PRIMARY KEY (id);

-- -- Name: dev_search_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_search ADD CONSTRAINT dev_search_pkey PRIMARY KEY (id);

-- -- Name: dev_topic_alia_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_topic ADD CONSTRAINT dev_topic_alia_name_key UNIQUE (name);

-- -- Name: dev_topic_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_topic ADD CONSTRAINT dev_topic_id_key UNIQUE (id);

-- -- Name: dev_wx_topic_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_wx_topic ADD CONSTRAINT dev_wx_topic_pkey PRIMARY KEY (id);

-- -- Name: dev_wx_user_openId_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_wx_users ADD CONSTRAINT "dev_wx_user_openId_key" UNIQUE ("openId");

-- -- Name: dev_wx_user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_wx_users ADD CONSTRAINT dev_wx_user_pkey PRIMARY KEY (id);

-- -- Name: dev_zhuanlan_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_zhuanlan ADD CONSTRAINT dev_zhuanlan_name_key UNIQUE (name);

-- -- Name: dev_zhuanlan_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_zhuanlan ADD CONSTRAINT dev_zhuanlan_pkey PRIMARY KEY (id);

-- -- Name: dev_zl_follow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_zl_follow ADD CONSTRAINT dev_zl_follow_pkey PRIMARY KEY (id);

-- -- Name: employees_email_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.employees ADD CONSTRAINT employees_email_unique UNIQUE (email);

-- -- Name: employees_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.employees ADD CONSTRAINT employees_pkey PRIMARY KEY (id);

-- -- Name: la_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.la_configs ADD CONSTRAINT la_configs_pkey PRIMARY KEY (id);

-- -- Name: la_menus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.la_menus ADD CONSTRAINT la_menus_pkey PRIMARY KEY (id);

-- -- Name: module_field_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.module_field_types ADD CONSTRAINT module_field_types_pkey PRIMARY KEY (id);

-- -- Name: module_fields_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.module_fields ADD CONSTRAINT module_fields_pkey PRIMARY KEY (id);

-- -- Name: modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.modules ADD CONSTRAINT modules_pkey PRIMARY KEY (id);

-- -- Name: organizations_email_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.organizations ADD CONSTRAINT organizations_email_unique UNIQUE (email);

-- -- Name: organizations_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.organizations ADD CONSTRAINT organizations_name_unique UNIQUE (name);

-- -- Name: organizations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.organizations ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);

-- -- Name: permission_role_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.permission_role ADD CONSTRAINT permission_role_pkey PRIMARY KEY (permission_id, role_id);

-- -- Name: permissions_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.permissions ADD CONSTRAINT permissions_name_unique UNIQUE (name);

-- -- Name: permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.permissions ADD CONSTRAINT permissions_pkey PRIMARY KEY (id);

-- -- Name: poem_book_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_poem_book ADD CONSTRAINT poem_book_pkey PRIMARY KEY (id);

-- -- Name: poem_dynasty_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.poem_dynasty ADD CONSTRAINT poem_dynasty_id_key UNIQUE (id);

-- -- Name: poem_like_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.dev_like ADD CONSTRAINT poem_like_pkey PRIMARY KEY (id);

-- -- Name: poem_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.poem_type ADD CONSTRAINT poem_type_pkey PRIMARY KEY (id);

-- -- Name: role_module_fields_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.role_module_fields ADD CONSTRAINT role_module_fields_pkey PRIMARY KEY (id);

-- -- Name: role_module_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.role_module ADD CONSTRAINT role_module_pkey PRIMARY KEY (id);

-- -- Name: role_user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.role_user ADD CONSTRAINT role_user_pkey PRIMARY KEY (id);

-- -- Name: roles_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.roles ADD CONSTRAINT roles_name_unique UNIQUE (name);

-- -- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.roles ADD CONSTRAINT roles_pkey PRIMARY KEY (id);

-- -- Name: uploads_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id);

-- -- Name: user_detail_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.user_detail ADD CONSTRAINT user_detail_name_key UNIQUE (name);

-- -- Name: user_detail_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.user_detail ADD CONSTRAINT user_detail_pkey PRIMARY KEY (id);

-- -- Name: user_detail_user_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.user_detail ADD CONSTRAINT user_detail_user_id_key UNIQUE (user_id);

-- -- Name: users_domain_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.users ADD CONSTRAINT users_domain_key UNIQUE (domain);

-- -- Name: users_email_unique; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.users ADD CONSTRAINT users_email_unique UNIQUE (email);

-- -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:

ALTER TABLE ONLY public.users ADD CONSTRAINT users_pkey PRIMARY KEY (id);

-- -- Name: password_resets_email_index; Type: INDEX; Schema: public; Owner: postgres; Tablespace:

CREATE INDEX password_resets_email_index ON public.password_resets USING btree (email);

-- -- Name: password_resets_token_index; Type: INDEX; Schema: public; Owner: postgres; Tablespace:

CREATE INDEX password_resets_token_index ON public.password_resets USING btree (token);

-- -- Name: employees_dept_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.employees ADD CONSTRAINT employees_dept_foreign FOREIGN KEY (dept) REFERENCES public.departments(id);

-- -- Name: module_fields_field_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.module_fields ADD CONSTRAINT module_fields_field_type_foreign FOREIGN KEY (field_type) REFERENCES public.module_field_types(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: module_fields_module_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.module_fields ADD CONSTRAINT module_fields_module_foreign FOREIGN KEY (module) REFERENCES public.modules(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: organizations_assigned_to_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.organizations ADD CONSTRAINT organizations_assigned_to_foreign FOREIGN KEY (assigned_to) REFERENCES public.employees(id);

-- -- Name: permission_role_permission_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.permission_role ADD CONSTRAINT permission_role_permission_id_foreign FOREIGN KEY (permission_id) REFERENCES public.permissions(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: permission_role_role_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.permission_role ADD CONSTRAINT permission_role_role_id_foreign FOREIGN KEY (role_id) REFERENCES public.roles(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: role_module_fields_field_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_module_fields ADD CONSTRAINT role_module_fields_field_id_foreign FOREIGN KEY (field_id) REFERENCES public.module_fields(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: role_module_fields_role_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_module_fields ADD CONSTRAINT role_module_fields_role_id_foreign FOREIGN KEY (role_id) REFERENCES public.roles(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: role_module_module_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_module ADD CONSTRAINT role_module_module_id_foreign FOREIGN KEY (module_id) REFERENCES public.modules(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: role_module_role_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_module ADD CONSTRAINT role_module_role_id_foreign FOREIGN KEY (role_id) REFERENCES public.roles(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: role_user_role_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_user ADD CONSTRAINT role_user_role_id_foreign FOREIGN KEY (role_id) REFERENCES public.roles(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: role_user_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.role_user ADD CONSTRAINT role_user_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;

-- -- Name: roles_dept_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.roles ADD CONSTRAINT roles_dept_foreign FOREIGN KEY (dept) REFERENCES public.departments(id);

-- -- Name: roles_parent_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.roles ADD CONSTRAINT roles_parent_foreign FOREIGN KEY (parent) REFERENCES public.roles(id);

-- -- Name: uploads_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.uploads ADD CONSTRAINT uploads_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id);

-- -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres

REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC;

-- -- PostgreSQL database dump complete

johnnyzhang1992 commented 5 years ago

其中 dev_ 开头的是网站需要的,devwx 是小程序需要的。

其它一些是用户系统和后台管理系统需要的。