--
-- PostgreSQL database dump
--

\restrict swEXqwojduBDQKpOx6Q25cRqHXnmaoe4Lr0hssIzgdaajrTqce9nudi6lVrIVLR

-- Dumped from database version 18.3 (Debian 18.3-1.pgdg13+1)
-- Dumped by pg_dump version 18.3 (Debian 18.3-1.pgdg13+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_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 xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: app_portal; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.app_portal (
    name character varying(64) NOT NULL,
    access_url character varying(500) NOT NULL,
    icon_url character varying(300),
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.app_portal OWNER TO admin;

--
-- Name: TABLE app_portal; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.app_portal IS '门户应用';


--
-- Name: COLUMN app_portal.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.name IS '应用名称';


--
-- Name: COLUMN app_portal.access_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.access_url IS '访问地址';


--
-- Name: COLUMN app_portal.icon_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.icon_url IS '应用图标URL';


--
-- Name: COLUMN app_portal.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.id IS '主键ID';


--
-- Name: COLUMN app_portal.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN app_portal.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN app_portal.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.description IS '备注/描述';


--
-- Name: COLUMN app_portal.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.created_time IS '创建时间';


--
-- Name: COLUMN app_portal.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.updated_time IS '更新时间';


--
-- Name: COLUMN app_portal.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.tenant_id IS '租户ID';


--
-- Name: COLUMN app_portal.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.created_id IS '创建人ID';


--
-- Name: COLUMN app_portal.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.app_portal.updated_id IS '更新人ID';


--
-- Name: app_portal_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.app_portal_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.app_portal_id_seq OWNER TO admin;

--
-- Name: app_portal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.app_portal_id_seq OWNED BY public.app_portal.id;


--
-- Name: apscheduler_jobs; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.apscheduler_jobs (
    id character varying(191) NOT NULL,
    next_run_time double precision,
    job_state bytea NOT NULL
);


ALTER TABLE public.apscheduler_jobs OWNER TO admin;

--
-- Name: gen_demo; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.gen_demo (
    name character varying(64) NOT NULL,
    a integer,
    b bigint,
    c double precision,
    d boolean NOT NULL,
    e date,
    f time without time zone,
    g timestamp without time zone,
    h text,
    i json,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.gen_demo OWNER TO admin;

--
-- Name: TABLE gen_demo; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.gen_demo IS '示例表';


--
-- Name: COLUMN gen_demo.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.name IS '名称';


--
-- Name: COLUMN gen_demo.a; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.a IS '整数';


--
-- Name: COLUMN gen_demo.b; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.b IS '大整数';


--
-- Name: COLUMN gen_demo.c; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.c IS '浮点数';


--
-- Name: COLUMN gen_demo.d; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.d IS '布尔型';


--
-- Name: COLUMN gen_demo.e; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.e IS '日期';


--
-- Name: COLUMN gen_demo.f; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.f IS '时间';


--
-- Name: COLUMN gen_demo.g; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.g IS '日期时间';


--
-- Name: COLUMN gen_demo.h; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.h IS '长文本';


--
-- Name: COLUMN gen_demo.i; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.i IS '元数据(JSON格式)';


--
-- Name: COLUMN gen_demo.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.id IS '主键ID';


--
-- Name: COLUMN gen_demo.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN gen_demo.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN gen_demo.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.description IS '备注/描述';


--
-- Name: COLUMN gen_demo.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.created_time IS '创建时间';


--
-- Name: COLUMN gen_demo.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.updated_time IS '更新时间';


--
-- Name: COLUMN gen_demo.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.created_id IS '创建人ID';


--
-- Name: COLUMN gen_demo.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo.updated_id IS '更新人ID';


--
-- Name: gen_demo01; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.gen_demo01 (
    name character varying(64) NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.gen_demo01 OWNER TO admin;

--
-- Name: TABLE gen_demo01; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.gen_demo01 IS '示例1表';


--
-- Name: COLUMN gen_demo01.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.name IS '名称';


--
-- Name: COLUMN gen_demo01.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.id IS '主键ID';


--
-- Name: COLUMN gen_demo01.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN gen_demo01.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN gen_demo01.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.description IS '备注/描述';


--
-- Name: COLUMN gen_demo01.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.created_time IS '创建时间';


--
-- Name: COLUMN gen_demo01.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.updated_time IS '更新时间';


--
-- Name: COLUMN gen_demo01.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.created_id IS '创建人ID';


--
-- Name: COLUMN gen_demo01.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_demo01.updated_id IS '更新人ID';


--
-- Name: gen_demo01_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.gen_demo01_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.gen_demo01_id_seq OWNER TO admin;

--
-- Name: gen_demo01_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.gen_demo01_id_seq OWNED BY public.gen_demo01.id;


--
-- Name: gen_demo_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.gen_demo_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.gen_demo_id_seq OWNER TO admin;

--
-- Name: gen_demo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.gen_demo_id_seq OWNED BY public.gen_demo.id;


--
-- Name: gen_table; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.gen_table (
    table_name character varying(200) NOT NULL,
    table_comment character varying(500),
    class_name character varying(100) NOT NULL,
    package_name character varying(100),
    module_name character varying(30),
    business_name character varying(30),
    function_name character varying(100),
    sub_table_name character varying(64) DEFAULT NULL::character varying,
    sub_table_fk_name character varying(64) DEFAULT NULL::character varying,
    parent_menu_id integer,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.gen_table OWNER TO admin;

--
-- Name: TABLE gen_table; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.gen_table IS '代码生成表';


--
-- Name: COLUMN gen_table.table_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.table_name IS '表名称';


--
-- Name: COLUMN gen_table.table_comment; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.table_comment IS '表描述';


--
-- Name: COLUMN gen_table.class_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.class_name IS '实体类名称';


--
-- Name: COLUMN gen_table.package_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.package_name IS '生成包路径';


--
-- Name: COLUMN gen_table.module_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.module_name IS '生成模块名';


--
-- Name: COLUMN gen_table.business_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.business_name IS '生成业务名';


--
-- Name: COLUMN gen_table.function_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.function_name IS '生成功能名';


--
-- Name: COLUMN gen_table.sub_table_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.sub_table_name IS '关联子表的表名';


--
-- Name: COLUMN gen_table.sub_table_fk_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.sub_table_fk_name IS '子表关联的外键名';


--
-- Name: COLUMN gen_table.parent_menu_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.parent_menu_id IS '父菜单ID';


--
-- Name: COLUMN gen_table.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.id IS '主键ID';


--
-- Name: COLUMN gen_table.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN gen_table.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN gen_table.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.description IS '备注/描述';


--
-- Name: COLUMN gen_table.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.created_time IS '创建时间';


--
-- Name: COLUMN gen_table.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.updated_time IS '更新时间';


--
-- Name: COLUMN gen_table.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.created_id IS '创建人ID';


--
-- Name: COLUMN gen_table.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table.updated_id IS '更新人ID';


--
-- Name: gen_table_column; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.gen_table_column (
    column_name character varying(200) NOT NULL,
    column_comment character varying(500),
    column_type character varying(100) NOT NULL,
    column_length character varying(50),
    column_default character varying(200),
    is_pk boolean DEFAULT false NOT NULL,
    is_increment boolean DEFAULT false NOT NULL,
    is_nullable boolean DEFAULT true NOT NULL,
    is_unique boolean DEFAULT false NOT NULL,
    python_type character varying(100),
    python_field character varying(200),
    is_insert boolean DEFAULT true NOT NULL,
    is_edit boolean DEFAULT true NOT NULL,
    is_list boolean DEFAULT true NOT NULL,
    is_query boolean DEFAULT false NOT NULL,
    query_type character varying(50),
    html_type character varying(100),
    dict_type character varying(200),
    sort integer NOT NULL,
    table_id integer NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.gen_table_column OWNER TO admin;

--
-- Name: TABLE gen_table_column; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.gen_table_column IS '代码生成表字段';


--
-- Name: COLUMN gen_table_column.column_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.column_name IS '列名称';


--
-- Name: COLUMN gen_table_column.column_comment; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.column_comment IS '列描述';


--
-- Name: COLUMN gen_table_column.column_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.column_type IS '列类型';


--
-- Name: COLUMN gen_table_column.column_length; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.column_length IS '列长度';


--
-- Name: COLUMN gen_table_column.column_default; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.column_default IS '列默认值';


--
-- Name: COLUMN gen_table_column.is_pk; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_pk IS '是否主键';


--
-- Name: COLUMN gen_table_column.is_increment; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_increment IS '是否自增';


--
-- Name: COLUMN gen_table_column.is_nullable; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_nullable IS '是否允许为空';


--
-- Name: COLUMN gen_table_column.is_unique; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_unique IS '是否唯一';


--
-- Name: COLUMN gen_table_column.python_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.python_type IS 'Python类型';


--
-- Name: COLUMN gen_table_column.python_field; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.python_field IS 'Python字段名';


--
-- Name: COLUMN gen_table_column.is_insert; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_insert IS '是否为新增字段';


--
-- Name: COLUMN gen_table_column.is_edit; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_edit IS '是否编辑字段';


--
-- Name: COLUMN gen_table_column.is_list; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_list IS '是否列表字段';


--
-- Name: COLUMN gen_table_column.is_query; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.is_query IS '是否查询字段';


--
-- Name: COLUMN gen_table_column.query_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.query_type IS '查询方式';


--
-- Name: COLUMN gen_table_column.html_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.html_type IS '显示类型';


--
-- Name: COLUMN gen_table_column.dict_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.dict_type IS '字典类型';


--
-- Name: COLUMN gen_table_column.sort; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.sort IS '排序';


--
-- Name: COLUMN gen_table_column.table_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.table_id IS '归属表编号';


--
-- Name: COLUMN gen_table_column.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.id IS '主键ID';


--
-- Name: COLUMN gen_table_column.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN gen_table_column.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN gen_table_column.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.description IS '备注/描述';


--
-- Name: COLUMN gen_table_column.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.created_time IS '创建时间';


--
-- Name: COLUMN gen_table_column.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.updated_time IS '更新时间';


--
-- Name: COLUMN gen_table_column.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.created_id IS '创建人ID';


--
-- Name: COLUMN gen_table_column.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.gen_table_column.updated_id IS '更新人ID';


--
-- Name: gen_table_column_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.gen_table_column_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.gen_table_column_id_seq OWNER TO admin;

--
-- Name: gen_table_column_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.gen_table_column_id_seq OWNED BY public.gen_table_column.id;


--
-- Name: gen_table_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.gen_table_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.gen_table_id_seq OWNER TO admin;

--
-- Name: gen_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.gen_table_id_seq OWNED BY public.gen_table.id;


--
-- Name: open_conf; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.open_conf (
    app_id character varying(64) NOT NULL,
    private_key character varying(2048),
    public_key character varying(2048),
    gateway_url character varying(256),
    sign_type character varying(32),
    charset character varying(32),
    format character varying(32),
    notify_url character varying(512),
    return_url character varying(512),
    app_cert_sn character varying(64),
    alipay_root_cert_sn character varying(64),
    encrypt_key character varying(64),
    status character varying(16) NOT NULL,
    description character varying(256),
    id bigint NOT NULL,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL
);


ALTER TABLE public.open_conf OWNER TO admin;

--
-- Name: TABLE open_conf; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.open_conf IS '三方配置表';


--
-- Name: COLUMN open_conf.app_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.app_id IS '应用ID';


--
-- Name: COLUMN open_conf.private_key; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.private_key IS '应用私钥(PKCS8格式)';


--
-- Name: COLUMN open_conf.public_key; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.public_key IS '平台公钥';


--
-- Name: COLUMN open_conf.gateway_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.gateway_url IS '支付宝网关地址';


--
-- Name: COLUMN open_conf.sign_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.sign_type IS '签名类型: RSA/RSA2';


--
-- Name: COLUMN open_conf.charset; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.charset IS '字符编码';


--
-- Name: COLUMN open_conf.format; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.format IS '数据格式';


--
-- Name: COLUMN open_conf.notify_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.notify_url IS '异步通知地址';


--
-- Name: COLUMN open_conf.return_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.return_url IS '同步返回地址';


--
-- Name: COLUMN open_conf.app_cert_sn; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.app_cert_sn IS '应用证书序列号';


--
-- Name: COLUMN open_conf.alipay_root_cert_sn; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.alipay_root_cert_sn IS '支付宝根证书序列号';


--
-- Name: COLUMN open_conf.encrypt_key; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.encrypt_key IS 'AES加密密钥';


--
-- Name: COLUMN open_conf.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.status IS '状态: ENABLED/DISABLED';


--
-- Name: COLUMN open_conf.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.description IS '配置描述';


--
-- Name: COLUMN open_conf.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.id IS '主键ID';


--
-- Name: COLUMN open_conf.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.created_time IS '创建时间';


--
-- Name: COLUMN open_conf.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.updated_time IS '更新时间';


--
-- Name: COLUMN open_conf.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_conf.tenant_id IS '租户ID';


--
-- Name: open_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.open_conf_id_seq OWNER TO admin;

--
-- Name: open_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.open_conf_id_seq OWNED BY public.open_conf.id;


--
-- Name: open_transfer; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.open_transfer (
    third_biz_no character varying(64) NOT NULL,
    out_biz_no character varying(64) NOT NULL,
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64),
    api_key character varying(256)
);


ALTER TABLE public.open_transfer OWNER TO admin;

--
-- Name: TABLE open_transfer; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.open_transfer IS '三方转账表';


--
-- Name: COLUMN open_transfer.third_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.third_biz_no IS '三方订单号';


--
-- Name: COLUMN open_transfer.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.out_biz_no IS '平台订单号';


--
-- Name: COLUMN open_transfer.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.id IS '主键ID';


--
-- Name: COLUMN open_transfer.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN open_transfer.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.description IS '备注/描述';


--
-- Name: COLUMN open_transfer.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.created_time IS '创建时间';


--
-- Name: COLUMN open_transfer.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.updated_time IS '更新时间';


--
-- Name: COLUMN open_transfer.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.tenant_id IS '租户ID';


--
-- Name: COLUMN open_transfer.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.enterprise_id IS '企业ID';


--
-- Name: COLUMN open_transfer.api_key; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.open_transfer.api_key IS 'API Key';


--
-- Name: open_transfer_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.open_transfer_id_seq OWNER TO admin;

--
-- Name: open_transfer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.open_transfer_id_seq OWNED BY public.open_transfer.id;


--
-- Name: pay_account; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_account (
    account_book_id character varying(64),
    account_name character varying(128),
    account_type character varying(32),
    scene character varying(32) NOT NULL,
    sign_status character varying(32) NOT NULL,
    sign_time timestamp without time zone,
    status character varying(32) NOT NULL,
    remark text,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_account OWNER TO admin;

--
-- Name: TABLE pay_account; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_account IS '资金专户表';


--
-- Name: COLUMN pay_account.account_book_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.account_book_id IS '资金专户号';


--
-- Name: COLUMN pay_account.account_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.account_name IS '账户名称';


--
-- Name: COLUMN pay_account.account_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.account_type IS '账户类型: INCOME/DISBURSE/ALL';


--
-- Name: COLUMN pay_account.scene; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.scene IS '应用场景码: ENT_CREDIT/B2B_TRANS';


--
-- Name: COLUMN pay_account.sign_status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.sign_status IS '签约状态: PENDING/AUTHORIZED/AUTHORIZE_FAILED/UNAUTHORIZED';


--
-- Name: COLUMN pay_account.sign_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.sign_time IS '签约时间';


--
-- Name: COLUMN pay_account.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.status IS '专户状态: ACTIVE/FROZEN/CLOSED';


--
-- Name: COLUMN pay_account.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.remark IS '备注';


--
-- Name: COLUMN pay_account.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.id IS '主键ID';


--
-- Name: COLUMN pay_account.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.description IS '备注/描述';


--
-- Name: COLUMN pay_account.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.created_time IS '创建时间';


--
-- Name: COLUMN pay_account.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.updated_time IS '更新时间';


--
-- Name: COLUMN pay_account.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_account.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_account.enterprise_id IS '企业ID';


--
-- Name: pay_account_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_account_id_seq OWNER TO admin;

--
-- Name: pay_account_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_account_id_seq OWNED BY public.pay_account.id;


--
-- Name: pay_alipay_notify_log; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_alipay_notify_log (
    notify_id character varying(50) NOT NULL,
    msg_method character varying(100) NOT NULL,
    notify_type character varying(100),
    message json NOT NULL,
    verify_result boolean NOT NULL,
    process_result boolean,
    error text,
    received_at timestamp without time zone NOT NULL,
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.pay_alipay_notify_log OWNER TO admin;

--
-- Name: TABLE pay_alipay_notify_log; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_alipay_notify_log IS '支付宝通知日志表';


--
-- Name: COLUMN pay_alipay_notify_log.notify_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.notify_id IS '通知ID';


--
-- Name: COLUMN pay_alipay_notify_log.msg_method; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.msg_method IS '消息接口名称';


--
-- Name: COLUMN pay_alipay_notify_log.notify_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.notify_type IS '通知类型';


--
-- Name: COLUMN pay_alipay_notify_log.message; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.message IS '完整的消息数据';


--
-- Name: COLUMN pay_alipay_notify_log.verify_result; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.verify_result IS '验签结果';


--
-- Name: COLUMN pay_alipay_notify_log.process_result; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.process_result IS '处理结果';


--
-- Name: COLUMN pay_alipay_notify_log.error; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.error IS '错误信息';


--
-- Name: COLUMN pay_alipay_notify_log.received_at; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.received_at IS '接收时间';


--
-- Name: COLUMN pay_alipay_notify_log.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.id IS '主键ID';


--
-- Name: COLUMN pay_alipay_notify_log.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN pay_alipay_notify_log.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.description IS '备注/描述';


--
-- Name: COLUMN pay_alipay_notify_log.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.created_time IS '创建时间';


--
-- Name: COLUMN pay_alipay_notify_log.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_alipay_notify_log.updated_time IS '更新时间';


--
-- Name: pay_alipay_notify_log_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_alipay_notify_log_id_seq OWNER TO admin;

--
-- Name: pay_alipay_notify_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_alipay_notify_log_id_seq OWNED BY public.pay_alipay_notify_log.id;


--
-- Name: pay_bill; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_bill (
    pay_no character varying(64) NOT NULL,
    account_id character varying(64) NOT NULL,
    employee_id character varying(64) NOT NULL,
    consume_type character varying(32) NOT NULL,
    consume_amount numeric(12,2) NOT NULL,
    gmt_biz_create timestamp without time zone NOT NULL,
    gmt_recieve_pay timestamp without time zone,
    peer_pay_amount numeric(12,2),
    notify_reason character varying(255) NOT NULL,
    notify_msg text,
    related_pay_no character varying(64),
    expense_rule_group_id character varying(64),
    expense_scene_code character varying(32),
    expense_type character varying(64),
    status character varying(32) NOT NULL,
    ext_infos json,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_bill OWNER TO admin;

--
-- Name: TABLE pay_bill; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_bill IS '企业码账单表';


--
-- Name: COLUMN pay_bill.pay_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.pay_no IS '支付宝账单号';


--
-- Name: COLUMN pay_bill.account_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.account_id IS '共同账户ID';


--
-- Name: COLUMN pay_bill.employee_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.employee_id IS '员工ID';


--
-- Name: COLUMN pay_bill.consume_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.consume_type IS '账单类型: CONSUME/REFUND/TRANSFER';


--
-- Name: COLUMN pay_bill.consume_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.consume_amount IS '账单金额';


--
-- Name: COLUMN pay_bill.gmt_biz_create; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.gmt_biz_create IS '账单创建时间';


--
-- Name: COLUMN pay_bill.gmt_recieve_pay; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.gmt_recieve_pay IS '支付时间';


--
-- Name: COLUMN pay_bill.peer_pay_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.peer_pay_amount IS '企业代付金额';


--
-- Name: COLUMN pay_bill.notify_reason; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.notify_reason IS '通知原因';


--
-- Name: COLUMN pay_bill.notify_msg; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.notify_msg IS '通知描述';


--
-- Name: COLUMN pay_bill.related_pay_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.related_pay_no IS '关联账单号';


--
-- Name: COLUMN pay_bill.expense_rule_group_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.expense_rule_group_id IS '费控规则ID';


--
-- Name: COLUMN pay_bill.expense_scene_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.expense_scene_code IS '费用场景';


--
-- Name: COLUMN pay_bill.expense_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.expense_type IS '费用类型';


--
-- Name: COLUMN pay_bill.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.status IS '状态: NEW/PROCESSED/FAILED';


--
-- Name: COLUMN pay_bill.ext_infos; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.ext_infos IS '扩展信息';


--
-- Name: COLUMN pay_bill.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.id IS '主键ID';


--
-- Name: COLUMN pay_bill.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.description IS '备注/描述';


--
-- Name: COLUMN pay_bill.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.created_time IS '创建时间';


--
-- Name: COLUMN pay_bill.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.updated_time IS '更新时间';


--
-- Name: COLUMN pay_bill.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_bill.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill.enterprise_id IS '企业ID';


--
-- Name: pay_bill_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_bill_id_seq OWNER TO admin;

--
-- Name: pay_bill_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_bill_id_seq OWNED BY public.pay_bill.id;


--
-- Name: pay_bill_order; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_bill_order (
    pay_no character varying(64) NOT NULL,
    order_no character varying(64) NOT NULL,
    trade_no character varying(64),
    product_code character varying(64),
    order_title character varying(255),
    order_amount numeric(12,2),
    order_status character varying(32),
    merchant_name character varying(255),
    merchant_id character varying(64),
    shop_name character varying(255),
    gmt_payment timestamp without time zone,
    fund_channel character varying(64),
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_bill_order OWNER TO admin;

--
-- Name: TABLE pay_bill_order; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_bill_order IS '账单订单明细表';


--
-- Name: COLUMN pay_bill_order.pay_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.pay_no IS '关联账单号';


--
-- Name: COLUMN pay_bill_order.order_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.order_no IS '支付宝订单号';


--
-- Name: COLUMN pay_bill_order.trade_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.trade_no IS '支付宝交易号';


--
-- Name: COLUMN pay_bill_order.product_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.product_code IS '产品码';


--
-- Name: COLUMN pay_bill_order.order_title; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.order_title IS '订单标题';


--
-- Name: COLUMN pay_bill_order.order_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.order_amount IS '订单金额';


--
-- Name: COLUMN pay_bill_order.order_status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.order_status IS '订单状态';


--
-- Name: COLUMN pay_bill_order.merchant_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.merchant_name IS '商户名称';


--
-- Name: COLUMN pay_bill_order.merchant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.merchant_id IS '商户ID';


--
-- Name: COLUMN pay_bill_order.shop_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.shop_name IS '门店名称';


--
-- Name: COLUMN pay_bill_order.gmt_payment; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.gmt_payment IS '支付时间';


--
-- Name: COLUMN pay_bill_order.fund_channel; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.fund_channel IS '资金渠道';


--
-- Name: COLUMN pay_bill_order.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.id IS '主键ID';


--
-- Name: COLUMN pay_bill_order.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN pay_bill_order.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.description IS '备注/描述';


--
-- Name: COLUMN pay_bill_order.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.created_time IS '创建时间';


--
-- Name: COLUMN pay_bill_order.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.updated_time IS '更新时间';


--
-- Name: COLUMN pay_bill_order.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_bill_order.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_order.enterprise_id IS '企业ID';


--
-- Name: pay_bill_order_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_bill_order_id_seq OWNER TO admin;

--
-- Name: pay_bill_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_bill_order_id_seq OWNED BY public.pay_bill_order.id;


--
-- Name: pay_bill_voucher; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_bill_voucher (
    pay_no character varying(64) NOT NULL,
    voucher_id character varying(64) NOT NULL,
    voucher_type character varying(32),
    voucher_status character varying(32),
    invoice_code character varying(64),
    invoice_no character varying(64),
    invoice_amount numeric(12,2),
    tax_amount numeric(12,2),
    issue_date timestamp without time zone,
    check_code character varying(64),
    pdf_url text,
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_bill_voucher OWNER TO admin;

--
-- Name: TABLE pay_bill_voucher; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_bill_voucher IS '账单凭证信息表';


--
-- Name: COLUMN pay_bill_voucher.pay_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.pay_no IS '关联账单号';


--
-- Name: COLUMN pay_bill_voucher.voucher_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.voucher_id IS '凭证ID';


--
-- Name: COLUMN pay_bill_voucher.voucher_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.voucher_type IS '凭证类型';


--
-- Name: COLUMN pay_bill_voucher.voucher_status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.voucher_status IS '凭证状态';


--
-- Name: COLUMN pay_bill_voucher.invoice_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.invoice_code IS '发票代码';


--
-- Name: COLUMN pay_bill_voucher.invoice_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.invoice_no IS '发票号码';


--
-- Name: COLUMN pay_bill_voucher.invoice_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.invoice_amount IS '发票金额';


--
-- Name: COLUMN pay_bill_voucher.tax_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.tax_amount IS '税额';


--
-- Name: COLUMN pay_bill_voucher.issue_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.issue_date IS '开票日期';


--
-- Name: COLUMN pay_bill_voucher.check_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.check_code IS '校验码';


--
-- Name: COLUMN pay_bill_voucher.pdf_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.pdf_url IS 'PDF下载地址';


--
-- Name: COLUMN pay_bill_voucher.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.id IS '主键ID';


--
-- Name: COLUMN pay_bill_voucher.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN pay_bill_voucher.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.description IS '备注/描述';


--
-- Name: COLUMN pay_bill_voucher.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.created_time IS '创建时间';


--
-- Name: COLUMN pay_bill_voucher.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.updated_time IS '更新时间';


--
-- Name: COLUMN pay_bill_voucher.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_bill_voucher.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_bill_voucher.enterprise_id IS '企业ID';


--
-- Name: pay_bill_voucher_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_bill_voucher_id_seq OWNER TO admin;

--
-- Name: pay_bill_voucher_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_bill_voucher_id_seq OWNED BY public.pay_bill_voucher.id;


--
-- Name: pay_department; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_department (
    id integer NOT NULL,
    department_id character varying(64) NOT NULL,
    department_name character varying(128) NOT NULL,
    department_code character varying(64),
    parent_department_id character varying(64),
    status character varying(32) NOT NULL,
    sort_order integer,
    leader_employee_id character varying(64),
    leader_employee_name character varying(128),
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    description text,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_department OWNER TO admin;

--
-- Name: TABLE pay_department; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_department IS '部门表';


--
-- Name: COLUMN pay_department.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.id IS '主键ID';


--
-- Name: COLUMN pay_department.department_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.department_id IS '部门ID';


--
-- Name: COLUMN pay_department.department_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.department_name IS '部门名称';


--
-- Name: COLUMN pay_department.department_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.department_code IS '部门编码';


--
-- Name: COLUMN pay_department.parent_department_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.parent_department_id IS '上级部门ID';


--
-- Name: COLUMN pay_department.status; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN pay_department.sort_order; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.sort_order IS '排序值';


--
-- Name: COLUMN pay_department.leader_employee_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.leader_employee_id IS '部门负责人ID';


--
-- Name: COLUMN pay_department.leader_employee_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.leader_employee_name IS '部门负责人姓名';


--
-- Name: COLUMN pay_department.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.created_time IS '创建时间';


--
-- Name: COLUMN pay_department.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.updated_time IS '更新时间';


--
-- Name: COLUMN pay_department.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.description IS '备注/描述';


--
-- Name: COLUMN pay_department.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_department.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_department.enterprise_id IS '企业ID';


--
-- Name: pay_department_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.pay_department_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.pay_department_id_seq OWNER TO admin;

--
-- Name: pay_department_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_department_id_seq OWNED BY public.pay_department.id;


--
-- Name: pay_deposit; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_deposit (
    out_biz_no character varying(64),
    account_book_id character varying(64),
    amount numeric(12,2),
    url text,
    status character varying(32) NOT NULL,
    notify_content json,
    remark text,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_deposit OWNER TO admin;

--
-- Name: TABLE pay_deposit; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_deposit IS '充值记录表';


--
-- Name: COLUMN pay_deposit.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.out_biz_no IS '商家侧订单号';


--
-- Name: COLUMN pay_deposit.account_book_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.account_book_id IS '资金专户号';


--
-- Name: COLUMN pay_deposit.amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.amount IS '充值金额';


--
-- Name: COLUMN pay_deposit.url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.url IS '充值确认页面URL';


--
-- Name: COLUMN pay_deposit.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.status IS '充值状态: DEALING/SUCCESS/FAIL';


--
-- Name: COLUMN pay_deposit.notify_content; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.notify_content IS '通知内容原始数据';


--
-- Name: COLUMN pay_deposit.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.remark IS '备注';


--
-- Name: COLUMN pay_deposit.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.id IS '主键ID';


--
-- Name: COLUMN pay_deposit.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.description IS '备注/描述';


--
-- Name: COLUMN pay_deposit.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.created_time IS '创建时间';


--
-- Name: COLUMN pay_deposit.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.updated_time IS '更新时间';


--
-- Name: COLUMN pay_deposit.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_deposit.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_deposit.enterprise_id IS '企业ID';


--
-- Name: pay_deposit_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_deposit_id_seq OWNER TO admin;

--
-- Name: pay_deposit_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_deposit_id_seq OWNED BY public.pay_deposit.id;


--
-- Name: pay_employee; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_employee (
    employee_id character varying(64),
    employee_name character varying(128),
    employee_no character varying(64),
    identity_type character varying(32),
    identity character varying(64),
    identity_open_id character varying(128),
    employee_mobile character varying(32),
    employee_email character varying(128),
    employee_cert_type character varying(32),
    employee_cert_no character varying(64),
    status character varying(32) NOT NULL,
    iot_check_type character varying(64),
    department_ids json,
    accounting_entity_ids json,
    label_names json,
    sign_return_url text,
    create_share_code boolean,
    sign_url_carry_info boolean,
    sign_url text,
    share_code character varying(128),
    iot_unique_id character varying(64),
    profiles json,
    withholding_sign_str text,
    free_sign_token character varying(256),
    department_list json,
    role_list json,
    user_id integer,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_employee OWNER TO admin;

--
-- Name: TABLE pay_employee; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_employee IS '员工表';


--
-- Name: COLUMN pay_employee.employee_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_id IS '员工ID(业务主键)';


--
-- Name: COLUMN pay_employee.employee_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_name IS '员工姓名';


--
-- Name: COLUMN pay_employee.employee_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_no IS '员工工号';


--
-- Name: COLUMN pay_employee.identity_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.identity_type IS '身份类型: ALIPAY_USER_ID/ALIPAY_LOGON_ID/ENTERPRISE_USER_ID';


--
-- Name: COLUMN pay_employee.identity; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.identity IS '身份标识';


--
-- Name: COLUMN pay_employee.identity_open_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.identity_open_id IS '员工openId';


--
-- Name: COLUMN pay_employee.employee_mobile; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_mobile IS '员工手机号';


--
-- Name: COLUMN pay_employee.employee_email; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_email IS '员工邮箱';


--
-- Name: COLUMN pay_employee.employee_cert_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_cert_type IS '证件类型: IDENTITY_CARD/PASSPORT/DRIVER_LICENSE';


--
-- Name: COLUMN pay_employee.employee_cert_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.employee_cert_no IS '证件号码';


--
-- Name: COLUMN pay_employee.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.status IS '状态: EMPLOYEE_CREATE/EMPLOYEE_ACTIVATED/EMPLOYEE_UNSIGN';


--
-- Name: COLUMN pay_employee.iot_check_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.iot_check_type IS 'IoT核身方式';


--
-- Name: COLUMN pay_employee.department_ids; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.department_ids IS '部门ID列表';


--
-- Name: COLUMN pay_employee.accounting_entity_ids; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.accounting_entity_ids IS '核算主体ID列表';


--
-- Name: COLUMN pay_employee.label_names; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.label_names IS '标签名称列表';


--
-- Name: COLUMN pay_employee.sign_return_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.sign_return_url IS '签约跳转URL';


--
-- Name: COLUMN pay_employee.create_share_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.create_share_code IS '是否创建分享码';


--
-- Name: COLUMN pay_employee.sign_url_carry_info; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.sign_url_carry_info IS '签约链接是否携带信息';


--
-- Name: COLUMN pay_employee.sign_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.sign_url IS '邀请链接';


--
-- Name: COLUMN pay_employee.share_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.share_code IS '分享码';


--
-- Name: COLUMN pay_employee.iot_unique_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.iot_unique_id IS 'IoT唯一标识';


--
-- Name: COLUMN pay_employee.profiles; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.profiles IS '扩展参数';


--
-- Name: COLUMN pay_employee.withholding_sign_str; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.withholding_sign_str IS '代扣签约串';


--
-- Name: COLUMN pay_employee.free_sign_token; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.free_sign_token IS '免登签约token';


--
-- Name: COLUMN pay_employee.department_list; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.department_list IS '部门列表';


--
-- Name: COLUMN pay_employee.role_list; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.role_list IS '角色列表';


--
-- Name: COLUMN pay_employee.user_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.user_id IS '关联的系统用户ID';


--
-- Name: COLUMN pay_employee.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.id IS '主键ID';


--
-- Name: COLUMN pay_employee.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.description IS '备注/描述';


--
-- Name: COLUMN pay_employee.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.created_time IS '创建时间';


--
-- Name: COLUMN pay_employee.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.updated_time IS '更新时间';


--
-- Name: COLUMN pay_employee.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_employee.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_employee.enterprise_id IS '企业ID';


--
-- Name: pay_employee_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_employee_id_seq OWNER TO admin;

--
-- Name: pay_employee_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_employee_id_seq OWNED BY public.pay_employee.id;


--
-- Name: pay_enterprise; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_enterprise (
    enterprise_id character varying(64),
    out_biz_no character varying(64),
    account_id character varying(64),
    name character varying(128),
    short_name character varying(64),
    status character varying(32) NOT NULL,
    sign_url text,
    pc_invite_url text,
    invite_time timestamp without time zone,
    expire_time timestamp without time zone,
    identity_type character varying(64),
    identity character varying(64),
    identity_open_id character varying(128),
    register_mode character varying(32),
    sign_fund_way character varying(32),
    base_info json,
    profiles json,
    remark text,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    service_provider_id bigint,
    scope_label character varying(64),
    business_license character varying(500),
    business_scenario text,
    business_contracts text,
    legal_rep_id_photo character varying(500),
    wanlihui_uid character varying(128)
);


ALTER TABLE public.pay_enterprise OWNER TO admin;

--
-- Name: TABLE pay_enterprise; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_enterprise IS '企业表';


--
-- Name: COLUMN pay_enterprise.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.enterprise_id IS '企业ID(业务主键)';


--
-- Name: COLUMN pay_enterprise.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.out_biz_no IS '外部业务号';


--
-- Name: COLUMN pay_enterprise.account_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.account_id IS '支付宝账号ID(签约后获取)';


--
-- Name: COLUMN pay_enterprise.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.name IS '企业名称';


--
-- Name: COLUMN pay_enterprise.short_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.short_name IS '企业简称';


--
-- Name: COLUMN pay_enterprise.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.status IS '状态: ENTERPRISE_APPLICATION/ENTERPRISE_CREATE/ENTERPRISE_ACTIVATED/ENTERPRISE_UNSIGN/ENTERPRISE_WITHDRAW/ENTERPRISE_AUTH/ENTERPRISE_AUTH_REJECTED';


--
-- Name: COLUMN pay_enterprise.sign_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.sign_url IS '签约链接';


--
-- Name: COLUMN pay_enterprise.pc_invite_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.pc_invite_url IS '邀请URL';


--
-- Name: COLUMN pay_enterprise.invite_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.invite_time IS '邀请码创建时间';


--
-- Name: COLUMN pay_enterprise.expire_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.expire_time IS '链接过期时间';


--
-- Name: COLUMN pay_enterprise.identity_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.identity_type IS '企业管理员身份类型: ALIPAY_USER_ID/ALIPAY_LOGON_ID/ISV_USER_ID';


--
-- Name: COLUMN pay_enterprise.identity; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.identity IS '企业管理员身份标识';


--
-- Name: COLUMN pay_enterprise.identity_open_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.identity_open_id IS '企业管理员openId';


--
-- Name: COLUMN pay_enterprise.register_mode; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.register_mode IS '注册模式: NORMAL/ISV_AGENT/ISV_VIRTUAL';


--
-- Name: COLUMN pay_enterprise.sign_fund_way; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.sign_fund_way IS '签约出资方式: BALANCE/CREDIT/CORPORATE_CARD/ENT_FA_EXPRESS/GEN_PER_ADV_PAY/CARD_PAY_LEDGER/PER_ALI_CREDIT';


--
-- Name: COLUMN pay_enterprise.base_info; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.base_info IS '企业基本信息: industry/enterprise_code/enterprise_name';


--
-- Name: COLUMN pay_enterprise.profiles; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.profiles IS '扩展参数: group_app_id/access_channel等';


--
-- Name: COLUMN pay_enterprise.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.remark IS '备注';


--
-- Name: COLUMN pay_enterprise.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.id IS '主键ID';


--
-- Name: COLUMN pay_enterprise.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.description IS '备注/描述';


--
-- Name: COLUMN pay_enterprise.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.created_time IS '创建时间';


--
-- Name: COLUMN pay_enterprise.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.updated_time IS '更新时间';


--
-- Name: COLUMN pay_enterprise.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_enterprise.tenant_id IS '租户ID';


--
-- Name: pay_enterprise_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_enterprise_id_seq OWNER TO admin;

--
-- Name: pay_enterprise_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_enterprise_id_seq OWNED BY public.pay_enterprise.id;


--
-- Name: pay_expense_institution; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_expense_institution (
    institution_id character varying(64),
    institution_name character varying(128),
    institution_desc text,
    scene_type character varying(32),
    expense_type character varying(32) NOT NULL,
    expense_sub_type character varying(32) NOT NULL,
    status character varying(32) NOT NULL,
    effective character varying(32),
    effective_start_date timestamp without time zone,
    effective_end_date timestamp without time zone,
    consult_mode character varying(32),
    multi_employee_share_mode character varying(32),
    currency character varying(32),
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64),
    grant_mode character varying(32),
    period_type character varying(32),
    amount numeric(12,2) DEFAULT 0,
    single_limit numeric(12,2) DEFAULT 0,
    effective_time_type character varying(32) DEFAULT 'unlimited'::character varying,
    applicable_scope character varying(32) DEFAULT 'none'::character varying
);


ALTER TABLE public.pay_expense_institution OWNER TO admin;

--
-- Name: TABLE pay_expense_institution; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_expense_institution IS '费控制度表';


--
-- Name: COLUMN pay_expense_institution.institution_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.institution_id IS '费控规则ID(创建后获取)';


--
-- Name: COLUMN pay_expense_institution.institution_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.institution_name IS '制度名称';


--
-- Name: COLUMN pay_expense_institution.institution_desc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.institution_desc IS '制度描述';


--
-- Name: COLUMN pay_expense_institution.scene_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.scene_type IS '因公场景';


--
-- Name: COLUMN pay_expense_institution.expense_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.expense_type IS '费用类型';


--
-- Name: COLUMN pay_expense_institution.expense_sub_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.expense_sub_type IS '费用类型子类';


--
-- Name: COLUMN pay_expense_institution.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.status IS '状态: INSTITUTION_CREATE/INSTITUTION_EFFECTIVE/INSTITUTION_INVALID';


--
-- Name: COLUMN pay_expense_institution.effective; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.effective IS '是否启用: 0(停用)/1(启用)';


--
-- Name: COLUMN pay_expense_institution.effective_start_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.effective_start_date IS '制度生效起始时间';


--
-- Name: COLUMN pay_expense_institution.effective_end_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.effective_end_date IS '制度生效结束时间';


--
-- Name: COLUMN pay_expense_institution.consult_mode; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.consult_mode IS '费控咨询模式: 0(支付宝内部计算)/1(咨询外部服务商)';


--
-- Name: COLUMN pay_expense_institution.multi_employee_share_mode; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.multi_employee_share_mode IS '多员工分享模式: 0(不分享)/1(分享)';


--
-- Name: COLUMN pay_expense_institution.currency; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.currency IS '货币类型';


--
-- Name: COLUMN pay_expense_institution.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.id IS '主键ID';


--
-- Name: COLUMN pay_expense_institution.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.description IS '备注/描述';


--
-- Name: COLUMN pay_expense_institution.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.created_time IS '创建时间';


--
-- Name: COLUMN pay_expense_institution.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.updated_time IS '更新时间';


--
-- Name: COLUMN pay_expense_institution.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_expense_institution.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_institution.enterprise_id IS '企业ID';


--
-- Name: pay_expense_institution_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_expense_institution_id_seq OWNER TO admin;

--
-- Name: pay_expense_institution_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_expense_institution_id_seq OWNED BY public.pay_expense_institution.id;


--
-- Name: pay_expense_issue_batch; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_expense_issue_batch (
    issue_batch_id character varying(64),
    batch_no character varying(64) NOT NULL,
    institution_id character varying(64) NOT NULL,
    issue_name character varying(64) NOT NULL,
    quota_type character varying(32) NOT NULL,
    share_mode character varying(8) NOT NULL,
    total_count integer NOT NULL,
    total_amount numeric(12,2),
    status character varying(32) NOT NULL,
    effective_start_date timestamp without time zone,
    effective_end_date timestamp without time zone,
    issue_desc text,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_expense_issue_batch OWNER TO admin;

--
-- Name: TABLE pay_expense_issue_batch; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_expense_issue_batch IS '手工发放批次表';


--
-- Name: COLUMN pay_expense_issue_batch.issue_batch_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.issue_batch_id IS '发放批次ID(支付宝返回)';


--
-- Name: COLUMN pay_expense_issue_batch.batch_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.batch_no IS '发放批次号(幂等)';


--
-- Name: COLUMN pay_expense_issue_batch.institution_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.institution_id IS '制度ID';


--
-- Name: COLUMN pay_expense_issue_batch.issue_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.issue_name IS '发放名称';


--
-- Name: COLUMN pay_expense_issue_batch.quota_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.quota_type IS '额度类型';


--
-- Name: COLUMN pay_expense_issue_batch.share_mode; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.share_mode IS '是否可转赠: 0/1';


--
-- Name: COLUMN pay_expense_issue_batch.total_count; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.total_count IS '发放总人数';


--
-- Name: COLUMN pay_expense_issue_batch.total_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.total_amount IS '发放总金额';


--
-- Name: COLUMN pay_expense_issue_batch.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.status IS '状态: ACTIVE/CANCELLED';


--
-- Name: COLUMN pay_expense_issue_batch.effective_start_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.effective_start_date IS '额度有效起始时间';


--
-- Name: COLUMN pay_expense_issue_batch.effective_end_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.effective_end_date IS '额度有效结束时间';


--
-- Name: COLUMN pay_expense_issue_batch.issue_desc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.issue_desc IS '发放说明';


--
-- Name: COLUMN pay_expense_issue_batch.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.id IS '主键ID';


--
-- Name: COLUMN pay_expense_issue_batch.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.description IS '备注/描述';


--
-- Name: COLUMN pay_expense_issue_batch.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.created_time IS '创建时间';


--
-- Name: COLUMN pay_expense_issue_batch.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.updated_time IS '更新时间';


--
-- Name: COLUMN pay_expense_issue_batch.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_expense_issue_batch.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_issue_batch.enterprise_id IS '企业ID';


--
-- Name: pay_expense_issue_batch_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_expense_issue_batch_id_seq OWNER TO admin;

--
-- Name: pay_expense_issue_batch_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_expense_issue_batch_id_seq OWNED BY public.pay_expense_issue_batch.id;


--
-- Name: pay_expense_quota; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_expense_quota (
    employee_id character varying(64) NOT NULL,
    institution_id character varying(64) NOT NULL,
    out_biz_no character varying(64),
    quota_id character varying(64),
    total_amount numeric(12,2),
    available_amount numeric(12,2),
    valid_from timestamp without time zone,
    valid_to timestamp without time zone,
    status character varying(32) NOT NULL,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64),
    quota_type character varying(32) DEFAULT 'CAP'::character varying,
    target_type character varying(32),
    target_id character varying(64)
);


ALTER TABLE public.pay_expense_quota OWNER TO admin;

--
-- Name: TABLE pay_expense_quota; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_expense_quota IS '额度表';


--
-- Name: COLUMN pay_expense_quota.employee_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.employee_id IS '员工ID';


--
-- Name: COLUMN pay_expense_quota.institution_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.institution_id IS '制度ID';


--
-- Name: COLUMN pay_expense_quota.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.out_biz_no IS '外部业务编号';


--
-- Name: COLUMN pay_expense_quota.quota_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.quota_id IS '额度ID(支付宝返回)';


--
-- Name: COLUMN pay_expense_quota.total_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.total_amount IS '总金额';


--
-- Name: COLUMN pay_expense_quota.available_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.available_amount IS '可用金额';


--
-- Name: COLUMN pay_expense_quota.valid_from; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.valid_from IS '有效期开始';


--
-- Name: COLUMN pay_expense_quota.valid_to; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.valid_to IS '有效期结束';


--
-- Name: COLUMN pay_expense_quota.status; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN pay_expense_quota.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.id IS '主键ID';


--
-- Name: COLUMN pay_expense_quota.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.description IS '备注/描述';


--
-- Name: COLUMN pay_expense_quota.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.created_time IS '创建时间';


--
-- Name: COLUMN pay_expense_quota.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.updated_time IS '更新时间';


--
-- Name: COLUMN pay_expense_quota.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_expense_quota.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota.enterprise_id IS '企业ID';


--
-- Name: pay_expense_quota_change_log; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_expense_quota_change_log (
    quota_id character varying(64) NOT NULL,
    employee_id character varying(64) NOT NULL,
    institution_id character varying(64) NOT NULL,
    change_type character varying(32) NOT NULL,
    coupon_name character varying(128),
    change_amount numeric(12,2) NOT NULL,
    before_amount numeric(12,2),
    after_amount numeric(12,2),
    change_desc text,
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64)
);


ALTER TABLE public.pay_expense_quota_change_log OWNER TO admin;

--
-- Name: TABLE pay_expense_quota_change_log; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_expense_quota_change_log IS '额度变更记录表';


--
-- Name: COLUMN pay_expense_quota_change_log.quota_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.quota_id IS '额度ID';


--
-- Name: COLUMN pay_expense_quota_change_log.employee_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.employee_id IS '员工ID';


--
-- Name: COLUMN pay_expense_quota_change_log.institution_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.institution_id IS '制度ID';


--
-- Name: COLUMN pay_expense_quota_change_log.change_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.change_type IS '变更类型: ISSUE(发放)/ADJUST(调整)/CANCEL(作废)';


--
-- Name: COLUMN pay_expense_quota_change_log.coupon_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.coupon_name IS '点券名称';


--
-- Name: COLUMN pay_expense_quota_change_log.change_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.change_amount IS '变更金额(正为增加，负为减少)';


--
-- Name: COLUMN pay_expense_quota_change_log.before_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.before_amount IS '变更前金额';


--
-- Name: COLUMN pay_expense_quota_change_log.after_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.after_amount IS '变更后金额';


--
-- Name: COLUMN pay_expense_quota_change_log.change_desc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.change_desc IS '变更说明';


--
-- Name: COLUMN pay_expense_quota_change_log.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.id IS '主键ID';


--
-- Name: COLUMN pay_expense_quota_change_log.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN pay_expense_quota_change_log.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.description IS '备注/描述';


--
-- Name: COLUMN pay_expense_quota_change_log.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.created_time IS '创建时间';


--
-- Name: COLUMN pay_expense_quota_change_log.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.updated_time IS '更新时间';


--
-- Name: COLUMN pay_expense_quota_change_log.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_expense_quota_change_log.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_quota_change_log.enterprise_id IS '企业ID';


--
-- Name: pay_expense_quota_change_log_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_expense_quota_change_log_id_seq OWNER TO admin;

--
-- Name: pay_expense_quota_change_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_expense_quota_change_log_id_seq OWNED BY public.pay_expense_quota_change_log.id;


--
-- Name: pay_expense_quota_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_expense_quota_id_seq OWNER TO admin;

--
-- Name: pay_expense_quota_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_expense_quota_id_seq OWNED BY public.pay_expense_quota.id;


--
-- Name: pay_expense_rule; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_expense_rule (
    out_biz_no character varying(64) NOT NULL,
    institution_id character varying(64) NOT NULL,
    rule_id character varying(64),
    standard_name character varying(128),
    standard_desc text,
    expense_type_sub_category character varying(32),
    status character varying(32) NOT NULL,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64),
    condition_info jsonb,
    single_limit numeric(12,2)
);


ALTER TABLE public.pay_expense_rule OWNER TO admin;

--
-- Name: TABLE pay_expense_rule; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_expense_rule IS '使用规则表';


--
-- Name: COLUMN pay_expense_rule.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.out_biz_no IS '外部业务编号';


--
-- Name: COLUMN pay_expense_rule.institution_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.institution_id IS '制度ID';


--
-- Name: COLUMN pay_expense_rule.rule_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.rule_id IS '规则ID(支付宝返回)';


--
-- Name: COLUMN pay_expense_rule.standard_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.standard_name IS '规则名称';


--
-- Name: COLUMN pay_expense_rule.standard_desc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.standard_desc IS '规则描述';


--
-- Name: COLUMN pay_expense_rule.expense_type_sub_category; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.expense_type_sub_category IS '费用类型子类';


--
-- Name: COLUMN pay_expense_rule.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.status IS '状态: RULE_ACTIVE/RULE_INACTIVE';


--
-- Name: COLUMN pay_expense_rule.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.id IS '主键ID';


--
-- Name: COLUMN pay_expense_rule.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.description IS '备注/描述';


--
-- Name: COLUMN pay_expense_rule.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.created_time IS '创建时间';


--
-- Name: COLUMN pay_expense_rule.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.updated_time IS '更新时间';


--
-- Name: COLUMN pay_expense_rule.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_expense_rule.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_expense_rule.enterprise_id IS '企业ID';


--
-- Name: pay_expense_rule_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_expense_rule_id_seq OWNER TO admin;

--
-- Name: pay_expense_rule_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_expense_rule_id_seq OWNED BY public.pay_expense_rule.id;


--
-- Name: pay_facetoface_order; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_facetoface_order (
    enterprise_id character varying(64),
    batch_no character varying(64),
    order_no character varying(64),
    order_status character varying(32) NOT NULL,
    account character varying(128),
    contact_name character varying(32),
    contact_mobile character varying(16),
    contact_email character varying(64),
    order_ticket character varying(40),
    rate character varying(8),
    sign_and_auth boolean NOT NULL,
    merchant_pid character varying(32),
    confirm_url text,
    app_auth_token character varying(128),
    app_refresh_token character varying(128),
    auth_app_id character varying(32),
    user_id character varying(32),
    open_id character varying(128),
    expires_in character varying(16),
    re_expires_in character varying(16),
    reject_reason text,
    remark text,
    last_query_time timestamp without time zone,
    next_query_time timestamp without time zone,
    query_count integer NOT NULL,
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    version integer DEFAULT 0
);


ALTER TABLE public.pay_facetoface_order OWNER TO admin;

--
-- Name: TABLE pay_facetoface_order; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_facetoface_order IS '当面付代开通申请单';


--
-- Name: COLUMN pay_facetoface_order.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.enterprise_id IS '关联企业ID';


--
-- Name: COLUMN pay_facetoface_order.batch_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.batch_no IS '支付宝事务编号';


--
-- Name: COLUMN pay_facetoface_order.order_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.order_no IS '签约单号';


--
-- Name: COLUMN pay_facetoface_order.order_status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.order_status IS '申请单状态';


--
-- Name: COLUMN pay_facetoface_order.account; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.account IS '商户支付宝账号/pid';


--
-- Name: COLUMN pay_facetoface_order.contact_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.contact_name IS '联系人名称';


--
-- Name: COLUMN pay_facetoface_order.contact_mobile; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.contact_mobile IS '联系人手机号';


--
-- Name: COLUMN pay_facetoface_order.contact_email; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.contact_email IS '联系人邮箱';


--
-- Name: COLUMN pay_facetoface_order.order_ticket; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.order_ticket IS '订单授权凭证（预授权模式）';


--
-- Name: COLUMN pay_facetoface_order.rate; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.rate IS '费率(sign_and_auth=true时必填)';


--
-- Name: COLUMN pay_facetoface_order.sign_and_auth; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.sign_and_auth IS '是否签约且授权';


--
-- Name: COLUMN pay_facetoface_order.merchant_pid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.merchant_pid IS '商户pid（query返回）';


--
-- Name: COLUMN pay_facetoface_order.confirm_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.confirm_url IS '商家确认链接';


--
-- Name: COLUMN pay_facetoface_order.app_auth_token; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.app_auth_token IS '应用授权令牌';


--
-- Name: COLUMN pay_facetoface_order.app_refresh_token; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.app_refresh_token IS '刷新令牌';


--
-- Name: COLUMN pay_facetoface_order.auth_app_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.auth_app_id IS '授权商户的appId';


--
-- Name: COLUMN pay_facetoface_order.user_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.user_id IS '授权商户的userId';


--
-- Name: COLUMN pay_facetoface_order.open_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.open_id IS '授权商户的openId';


--
-- Name: COLUMN pay_facetoface_order.expires_in; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.expires_in IS '授权令牌过期秒数';


--
-- Name: COLUMN pay_facetoface_order.re_expires_in; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.re_expires_in IS '刷新令牌过期秒数';


--
-- Name: COLUMN pay_facetoface_order.reject_reason; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.reject_reason IS '驳回原因';


--
-- Name: COLUMN pay_facetoface_order.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.remark IS '备注';


--
-- Name: COLUMN pay_facetoface_order.last_query_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.last_query_time IS '最后查询时间';


--
-- Name: COLUMN pay_facetoface_order.next_query_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.next_query_time IS '下次查询时间';


--
-- Name: COLUMN pay_facetoface_order.query_count; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.query_count IS '已查询次数';


--
-- Name: COLUMN pay_facetoface_order.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.id IS '主键ID';


--
-- Name: COLUMN pay_facetoface_order.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN pay_facetoface_order.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.description IS '备注/描述';


--
-- Name: COLUMN pay_facetoface_order.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.created_time IS '创建时间';


--
-- Name: COLUMN pay_facetoface_order.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.updated_time IS '更新时间';


--
-- Name: COLUMN pay_facetoface_order.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_facetoface_order.tenant_id IS '租户ID';


--
-- Name: pay_facetoface_order_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_facetoface_order_id_seq OWNER TO admin;

--
-- Name: pay_facetoface_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_facetoface_order_id_seq OWNED BY public.pay_facetoface_order.id;


--
-- Name: pay_points; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_points (
    points numeric(12,2) NOT NULL,
    status character varying(32) NOT NULL,
    rule character varying(64),
    ext_info json,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL
);


ALTER TABLE public.pay_points OWNER TO admin;

--
-- Name: TABLE pay_points; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_points IS '积分表';


--
-- Name: COLUMN pay_points.points; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.points IS '积分余额';


--
-- Name: COLUMN pay_points.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.status IS '状态: ACTIVE/FROZEN';


--
-- Name: COLUMN pay_points.rule; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.rule IS '积分规则';


--
-- Name: COLUMN pay_points.ext_info; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.ext_info IS '扩展信息';


--
-- Name: COLUMN pay_points.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.id IS '主键ID';


--
-- Name: COLUMN pay_points.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.description IS '备注/描述';


--
-- Name: COLUMN pay_points.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.created_time IS '创建时间';


--
-- Name: COLUMN pay_points.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.updated_time IS '更新时间';


--
-- Name: COLUMN pay_points.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points.tenant_id IS '租户ID';


--
-- Name: pay_points_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_points_id_seq OWNER TO admin;

--
-- Name: pay_points_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_points_id_seq OWNED BY public.pay_points.id;


--
-- Name: pay_points_record; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_points_record (
    enterprise_id character varying(64),
    employee_id character varying(64),
    points numeric(12,2) NOT NULL,
    balance numeric(12,2) NOT NULL,
    type character varying(32),
    business_type character varying(32),
    business_id character varying(64),
    remark text,
    ext_info json,
    id bigint NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL
);


ALTER TABLE public.pay_points_record OWNER TO admin;

--
-- Name: TABLE pay_points_record; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_points_record IS '积分变动记录表';


--
-- Name: COLUMN pay_points_record.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.enterprise_id IS '企业ID';


--
-- Name: COLUMN pay_points_record.employee_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.employee_id IS '员工ID';


--
-- Name: COLUMN pay_points_record.points; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.points IS '变动积分';


--
-- Name: COLUMN pay_points_record.balance; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.balance IS '变动后余额';


--
-- Name: COLUMN pay_points_record.type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.type IS '变动类型: ADD/DEDUCT';


--
-- Name: COLUMN pay_points_record.business_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.business_type IS '业务类型: TRANSFER';


--
-- Name: COLUMN pay_points_record.business_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.business_id IS '业务ID';


--
-- Name: COLUMN pay_points_record.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.remark IS '备注';


--
-- Name: COLUMN pay_points_record.ext_info; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.ext_info IS '扩展信息';


--
-- Name: COLUMN pay_points_record.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.id IS '主键ID';


--
-- Name: COLUMN pay_points_record.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN pay_points_record.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.description IS '备注/描述';


--
-- Name: COLUMN pay_points_record.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.created_time IS '创建时间';


--
-- Name: COLUMN pay_points_record.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.updated_time IS '更新时间';


--
-- Name: COLUMN pay_points_record.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_points_record.tenant_id IS '租户ID';


--
-- Name: pay_points_record_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_points_record_id_seq OWNER TO admin;

--
-- Name: pay_points_record_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_points_record_id_seq OWNED BY public.pay_points_record.id;


--
-- Name: pay_service_provider; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_service_provider (
    id bigint NOT NULL,
    name character varying(64) NOT NULL,
    scope_label character varying(64) DEFAULT 'DOMESTIC'::character varying,
    app_id character varying(64) NOT NULL,
    app_private_key text NOT NULL,
    alipay_public_key text NOT NULL,
    server_url character varying(256) DEFAULT 'https://openapi.alipay.com/gateway.do'::character varying,
    sign_type character varying(16) DEFAULT 'RSA2'::character varying,
    format character varying(16) DEFAULT 'JSON'::character varying,
    charset character varying(16) DEFAULT 'UTF-8'::character varying,
    provider_status character varying(32) DEFAULT 'ACTIVE'::character varying,
    description character varying(512),
    status character varying(1) DEFAULT '0'::character varying,
    uuid character varying(64),
    created_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.pay_service_provider OWNER TO admin;

--
-- Name: pay_service_provider_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_service_provider_id_seq OWNER TO admin;

--
-- Name: pay_service_provider_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_service_provider_id_seq OWNED BY public.pay_service_provider.id;


--
-- Name: pay_service_provider_profile; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_service_provider_profile (
    id bigint NOT NULL,
    service_provider_id bigint NOT NULL,
    biz_type character varying(32) NOT NULL,
    app_id character varying(64),
    app_private_key text,
    alipay_public_key text,
    app_cert_content text,
    alipay_public_cert_content text,
    root_cert_content text,
    server_url character varying(256),
    format character varying(16) DEFAULT 'JSON'::character varying,
    charset character varying(16) DEFAULT 'UTF-8'::character varying,
    sign_type character varying(16) DEFAULT 'RSA2'::character varying,
    description character varying(512),
    created_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    status character varying(1) DEFAULT '0'::character varying
);


ALTER TABLE public.pay_service_provider_profile OWNER TO admin;

--
-- Name: pay_service_provider_profile_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_service_provider_profile_id_seq OWNER TO admin;

--
-- Name: pay_service_provider_profile_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_service_provider_profile_id_seq OWNED BY public.pay_service_provider_profile.id;


--
-- Name: pay_transfer; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_transfer (
    out_biz_no character varying(64),
    account_book_id character varying(64),
    amount numeric(12,2),
    order_title character varying(64),
    payee_info json,
    status character varying(32) NOT NULL,
    order_no character varying(64),
    fund_order_id character varying(64),
    error_code character varying(64),
    error_msg text,
    ext_info json,
    remark text,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    enterprise_id character varying(64),
    payee_type character varying(32),
    retry_count integer DEFAULT 0 NOT NULL,
    next_retry_at timestamp without time zone
);


ALTER TABLE public.pay_transfer OWNER TO admin;

--
-- Name: TABLE pay_transfer; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_transfer IS '转账记录表';


--
-- Name: COLUMN pay_transfer.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.out_biz_no IS '商家侧订单号';


--
-- Name: COLUMN pay_transfer.account_book_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.account_book_id IS '付款方资金专户号';


--
-- Name: COLUMN pay_transfer.amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.amount IS '转账金额';


--
-- Name: COLUMN pay_transfer.order_title; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.order_title IS '转账标题';


--
-- Name: COLUMN pay_transfer.payee_info; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.payee_info IS '收款方信息';


--
-- Name: COLUMN pay_transfer.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.status IS '转账状态: DEALING/SUCCESS/FAIL/REFUND';


--
-- Name: COLUMN pay_transfer.order_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.order_no IS '支付宝转账单号';


--
-- Name: COLUMN pay_transfer.fund_order_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.fund_order_id IS '宝支付资金流水号';


--
-- Name: COLUMN pay_transfer.error_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.error_code IS '错误码';


--
-- Name: COLUMN pay_transfer.error_msg; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.error_msg IS '错误信息';


--
-- Name: COLUMN pay_transfer.ext_info; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.ext_info IS '扩展信息';


--
-- Name: COLUMN pay_transfer.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.remark IS '备注';


--
-- Name: COLUMN pay_transfer.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.id IS '主键ID';


--
-- Name: COLUMN pay_transfer.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.description IS '备注/描述';


--
-- Name: COLUMN pay_transfer.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.created_time IS '创建时间';


--
-- Name: COLUMN pay_transfer.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.updated_time IS '更新时间';


--
-- Name: COLUMN pay_transfer.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.tenant_id IS '租户ID';


--
-- Name: COLUMN pay_transfer.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_transfer.enterprise_id IS '企业ID';


--
-- Name: pay_transfer_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_transfer_id_seq OWNER TO admin;

--
-- Name: pay_transfer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_transfer_id_seq OWNED BY public.pay_transfer.id;


--
-- Name: pay_withdraw; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.pay_withdraw (
    enterprise_id character varying(64),
    out_biz_no character varying(64),
    account_book_id character varying(64),
    amount numeric(12,2),
    status character varying(32) NOT NULL,
    order_no character varying(64),
    notify_content json,
    error_code character varying(64),
    error_msg text,
    remark text,
    id bigint NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL
);


ALTER TABLE public.pay_withdraw OWNER TO admin;

--
-- Name: TABLE pay_withdraw; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.pay_withdraw IS '提现记录表';


--
-- Name: COLUMN pay_withdraw.enterprise_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.enterprise_id IS '所属企业ID';


--
-- Name: COLUMN pay_withdraw.out_biz_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.out_biz_no IS '商家侧订单号';


--
-- Name: COLUMN pay_withdraw.account_book_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.account_book_id IS '资金专户号';


--
-- Name: COLUMN pay_withdraw.amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.amount IS '提现金额';


--
-- Name: COLUMN pay_withdraw.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.status IS '提现状态: DEALING/SUCCESS/FAIL';


--
-- Name: COLUMN pay_withdraw.order_no; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.order_no IS '支付宝提现单号';


--
-- Name: COLUMN pay_withdraw.notify_content; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.notify_content IS '通知内容原始数据';


--
-- Name: COLUMN pay_withdraw.error_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.error_code IS '错误码';


--
-- Name: COLUMN pay_withdraw.error_msg; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.error_msg IS '错误信息';


--
-- Name: COLUMN pay_withdraw.remark; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.remark IS '备注';


--
-- Name: COLUMN pay_withdraw.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.id IS '主键ID';


--
-- Name: COLUMN pay_withdraw.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.description IS '备注/描述';


--
-- Name: COLUMN pay_withdraw.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.created_time IS '创建时间';


--
-- Name: COLUMN pay_withdraw.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.updated_time IS '更新时间';


--
-- Name: COLUMN pay_withdraw.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.pay_withdraw.tenant_id IS '租户ID';


--
-- Name: pay_withdraw_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.pay_withdraw_id_seq OWNER TO admin;

--
-- Name: pay_withdraw_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.pay_withdraw_id_seq OWNED BY public.pay_withdraw.id;


--
-- Name: sys_dept; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_dept (
    name character varying(64) NOT NULL,
    "order" integer NOT NULL,
    code character varying(16) NOT NULL,
    leader character varying(32),
    phone character varying(11),
    email character varying(64),
    parent_id integer,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_dept OWNER TO admin;

--
-- Name: TABLE sys_dept; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_dept IS '部门表';


--
-- Name: COLUMN sys_dept.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.name IS '部门名称';


--
-- Name: COLUMN sys_dept."order"; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept."order" IS '显示排序';


--
-- Name: COLUMN sys_dept.code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.code IS '部门编码';


--
-- Name: COLUMN sys_dept.leader; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.leader IS '部门负责人';


--
-- Name: COLUMN sys_dept.phone; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.phone IS '手机';


--
-- Name: COLUMN sys_dept.email; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN sys_dept.parent_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.parent_id IS '父级部门ID';


--
-- Name: COLUMN sys_dept.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.id IS '主键ID';


--
-- Name: COLUMN sys_dept.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_dept.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_dept.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.description IS '备注/描述';


--
-- Name: COLUMN sys_dept.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.created_time IS '创建时间';


--
-- Name: COLUMN sys_dept.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dept.updated_time IS '更新时间';


--
-- Name: sys_dept_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_dept_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_dept_id_seq OWNER TO admin;

--
-- Name: sys_dept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_dept_id_seq OWNED BY public.sys_dept.id;


--
-- Name: sys_dict_data; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_dict_data (
    dict_sort integer NOT NULL,
    dict_label character varying(255) NOT NULL,
    dict_value character varying(255) NOT NULL,
    css_class character varying(255),
    list_class character varying(255),
    is_default boolean NOT NULL,
    dict_type character varying(255) NOT NULL,
    dict_type_id integer NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_dict_data OWNER TO admin;

--
-- Name: TABLE sys_dict_data; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_dict_data IS '字典数据表';


--
-- Name: COLUMN sys_dict_data.dict_sort; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.dict_sort IS '字典排序';


--
-- Name: COLUMN sys_dict_data.dict_label; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.dict_label IS '字典标签';


--
-- Name: COLUMN sys_dict_data.dict_value; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.dict_value IS '字典键值';


--
-- Name: COLUMN sys_dict_data.css_class; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.css_class IS '样式属性（其他样式扩展）';


--
-- Name: COLUMN sys_dict_data.list_class; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.list_class IS '表格回显样式';


--
-- Name: COLUMN sys_dict_data.is_default; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.is_default IS '是否默认（True是 False否）';


--
-- Name: COLUMN sys_dict_data.dict_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.dict_type IS '字典类型';


--
-- Name: COLUMN sys_dict_data.dict_type_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.dict_type_id IS '字典类型ID';


--
-- Name: COLUMN sys_dict_data.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.id IS '主键ID';


--
-- Name: COLUMN sys_dict_data.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_dict_data.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_dict_data.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.description IS '备注/描述';


--
-- Name: COLUMN sys_dict_data.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.created_time IS '创建时间';


--
-- Name: COLUMN sys_dict_data.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_data.updated_time IS '更新时间';


--
-- Name: sys_dict_data_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_dict_data_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_dict_data_id_seq OWNER TO admin;

--
-- Name: sys_dict_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_dict_data_id_seq OWNED BY public.sys_dict_data.id;


--
-- Name: sys_dict_type; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_dict_type (
    dict_name character varying(64) NOT NULL,
    dict_type character varying(255) NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_dict_type OWNER TO admin;

--
-- Name: TABLE sys_dict_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_dict_type IS '字典类型表';


--
-- Name: COLUMN sys_dict_type.dict_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.dict_name IS '字典名称';


--
-- Name: COLUMN sys_dict_type.dict_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.dict_type IS '字典类型';


--
-- Name: COLUMN sys_dict_type.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.id IS '主键ID';


--
-- Name: COLUMN sys_dict_type.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_dict_type.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_dict_type.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.description IS '备注/描述';


--
-- Name: COLUMN sys_dict_type.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.created_time IS '创建时间';


--
-- Name: COLUMN sys_dict_type.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_dict_type.updated_time IS '更新时间';


--
-- Name: sys_dict_type_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_dict_type_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_dict_type_id_seq OWNER TO admin;

--
-- Name: sys_dict_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_dict_type_id_seq OWNED BY public.sys_dict_type.id;


--
-- Name: sys_invitation_code; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_invitation_code (
    id bigint NOT NULL,
    uuid character varying(64),
    status character varying(1) DEFAULT '0'::character varying,
    code character varying(64) NOT NULL,
    used_by bigint,
    used_time timestamp with time zone,
    created_by bigint,
    description character varying(255),
    created_time timestamp with time zone DEFAULT now(),
    updated_time timestamp with time zone DEFAULT now()
);


ALTER TABLE public.sys_invitation_code OWNER TO admin;

--
-- Name: sys_invitation_code_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER SEQUENCE public.sys_invitation_code_id_seq OWNER TO admin;

--
-- Name: sys_invitation_code_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_invitation_code_id_seq OWNED BY public.sys_invitation_code.id;


--
-- Name: sys_log; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_log (
    type integer NOT NULL,
    request_path character varying(255) NOT NULL,
    request_method character varying(10) NOT NULL,
    request_payload text,
    request_ip character varying(50),
    login_location character varying(255),
    request_os character varying(64),
    request_browser character varying(64),
    response_code integer NOT NULL,
    response_json text,
    process_time character varying(20),
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.sys_log OWNER TO admin;

--
-- Name: TABLE sys_log; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_log IS '系统日志表';


--
-- Name: COLUMN sys_log.type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.type IS '日志类型(1登录日志 2操作日志)';


--
-- Name: COLUMN sys_log.request_path; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.request_path IS '请求路径';


--
-- Name: COLUMN sys_log.request_method; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.request_method IS '请求方式';


--
-- Name: COLUMN sys_log.request_payload; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.request_payload IS '请求体';


--
-- Name: COLUMN sys_log.request_ip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.request_ip IS '请求IP地址';


--
-- Name: COLUMN sys_log.login_location; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.login_location IS '登录位置';


--
-- Name: COLUMN sys_log.request_os; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.request_os IS '操作系统';


--
-- Name: COLUMN sys_log.request_browser; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.request_browser IS '浏览器';


--
-- Name: COLUMN sys_log.response_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.response_code IS '响应状态码';


--
-- Name: COLUMN sys_log.response_json; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.response_json IS '响应体';


--
-- Name: COLUMN sys_log.process_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.process_time IS '处理时间';


--
-- Name: COLUMN sys_log.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.id IS '主键ID';


--
-- Name: COLUMN sys_log.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_log.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_log.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.description IS '备注/描述';


--
-- Name: COLUMN sys_log.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.created_time IS '创建时间';


--
-- Name: COLUMN sys_log.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.updated_time IS '更新时间';


--
-- Name: COLUMN sys_log.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.created_id IS '创建人ID';


--
-- Name: COLUMN sys_log.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_log.updated_id IS '更新人ID';


--
-- Name: sys_log_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_log_id_seq OWNER TO admin;

--
-- Name: sys_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_log_id_seq OWNED BY public.sys_log.id;


--
-- Name: sys_menu; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_menu (
    name character varying(50) NOT NULL,
    type integer NOT NULL,
    "order" integer NOT NULL,
    permission character varying(100),
    icon character varying(50),
    route_name character varying(100),
    route_path character varying(200),
    component_path character varying(200),
    redirect character varying(200),
    hidden boolean NOT NULL,
    keep_alive boolean NOT NULL,
    always_show boolean NOT NULL,
    title character varying(50),
    params json,
    affix boolean NOT NULL,
    parent_id integer,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_menu OWNER TO admin;

--
-- Name: TABLE sys_menu; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_menu IS '菜单表';


--
-- Name: COLUMN sys_menu.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.name IS '菜单名称';


--
-- Name: COLUMN sys_menu.type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.type IS '菜单类型(1:目录 2:菜单 3:按钮/权限 4:链接)';


--
-- Name: COLUMN sys_menu."order"; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu."order" IS '显示排序';


--
-- Name: COLUMN sys_menu.permission; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.permission IS '权限标识(如:module_system:user:query)';


--
-- Name: COLUMN sys_menu.icon; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.icon IS '菜单图标';


--
-- Name: COLUMN sys_menu.route_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.route_name IS '路由名称';


--
-- Name: COLUMN sys_menu.route_path; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.route_path IS '路由路径';


--
-- Name: COLUMN sys_menu.component_path; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.component_path IS '组件路径';


--
-- Name: COLUMN sys_menu.redirect; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.redirect IS '重定向地址';


--
-- Name: COLUMN sys_menu.hidden; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.hidden IS '是否隐藏(True:隐藏 False:显示)';


--
-- Name: COLUMN sys_menu.keep_alive; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.keep_alive IS '是否缓存(True:是 False:否)';


--
-- Name: COLUMN sys_menu.always_show; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.always_show IS '是否始终显示(True:是 False:否)';


--
-- Name: COLUMN sys_menu.title; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.title IS '菜单标题';


--
-- Name: COLUMN sys_menu.params; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.params IS '路由参数(JSON对象)';


--
-- Name: COLUMN sys_menu.affix; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.affix IS '是否固定标签页(True:是 False:否)';


--
-- Name: COLUMN sys_menu.parent_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.parent_id IS '父菜单ID';


--
-- Name: COLUMN sys_menu.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.id IS '主键ID';


--
-- Name: COLUMN sys_menu.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_menu.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_menu.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.description IS '备注/描述';


--
-- Name: COLUMN sys_menu.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.created_time IS '创建时间';


--
-- Name: COLUMN sys_menu.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_menu.updated_time IS '更新时间';


--
-- Name: sys_menu_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_menu_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_menu_id_seq OWNER TO admin;

--
-- Name: sys_menu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_menu_id_seq OWNED BY public.sys_menu.id;


--
-- Name: sys_notice; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_notice (
    notice_title character varying(64) NOT NULL,
    notice_type character varying(1) NOT NULL,
    notice_content text,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.sys_notice OWNER TO admin;

--
-- Name: TABLE sys_notice; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_notice IS '通知公告表';


--
-- Name: COLUMN sys_notice.notice_title; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.notice_title IS '公告标题';


--
-- Name: COLUMN sys_notice.notice_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.notice_type IS '公告类型(1通知 2公告)';


--
-- Name: COLUMN sys_notice.notice_content; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.notice_content IS '公告内容';


--
-- Name: COLUMN sys_notice.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.id IS '主键ID';


--
-- Name: COLUMN sys_notice.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_notice.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_notice.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.description IS '备注/描述';


--
-- Name: COLUMN sys_notice.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.created_time IS '创建时间';


--
-- Name: COLUMN sys_notice.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.updated_time IS '更新时间';


--
-- Name: COLUMN sys_notice.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.created_id IS '创建人ID';


--
-- Name: COLUMN sys_notice.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_notice.updated_id IS '更新人ID';


--
-- Name: sys_notice_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_notice_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_notice_id_seq OWNER TO admin;

--
-- Name: sys_notice_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_notice_id_seq OWNED BY public.sys_notice.id;


--
-- Name: sys_param; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_param (
    config_name character varying(64) NOT NULL,
    config_key character varying(500) NOT NULL,
    config_value character varying(500),
    config_type boolean,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_param OWNER TO admin;

--
-- Name: TABLE sys_param; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_param IS '系统参数表';


--
-- Name: COLUMN sys_param.config_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.config_name IS '参数名称';


--
-- Name: COLUMN sys_param.config_key; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.config_key IS '参数键名';


--
-- Name: COLUMN sys_param.config_value; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.config_value IS '参数键值';


--
-- Name: COLUMN sys_param.config_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.config_type IS '系统内置(True:是 False:否)';


--
-- Name: COLUMN sys_param.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.id IS '主键ID';


--
-- Name: COLUMN sys_param.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_param.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_param.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.description IS '备注/描述';


--
-- Name: COLUMN sys_param.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.created_time IS '创建时间';


--
-- Name: COLUMN sys_param.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_param.updated_time IS '更新时间';


--
-- Name: sys_param_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_param_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_param_id_seq OWNER TO admin;

--
-- Name: sys_param_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_param_id_seq OWNED BY public.sys_param.id;


--
-- Name: sys_position; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_position (
    name character varying(64) NOT NULL,
    "order" integer NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.sys_position OWNER TO admin;

--
-- Name: TABLE sys_position; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_position IS '岗位表';


--
-- Name: COLUMN sys_position.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.name IS '岗位名称';


--
-- Name: COLUMN sys_position."order"; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position."order" IS '显示排序';


--
-- Name: COLUMN sys_position.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.id IS '主键ID';


--
-- Name: COLUMN sys_position.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_position.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_position.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.description IS '备注/描述';


--
-- Name: COLUMN sys_position.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.created_time IS '创建时间';


--
-- Name: COLUMN sys_position.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.updated_time IS '更新时间';


--
-- Name: COLUMN sys_position.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.created_id IS '创建人ID';


--
-- Name: COLUMN sys_position.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_position.updated_id IS '更新人ID';


--
-- Name: sys_position_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_position_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_position_id_seq OWNER TO admin;

--
-- Name: sys_position_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_position_id_seq OWNED BY public.sys_position.id;


--
-- Name: sys_role; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_role (
    name character varying(64) NOT NULL,
    code character varying(16) NOT NULL,
    "order" integer NOT NULL,
    data_scope integer NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_role OWNER TO admin;

--
-- Name: TABLE sys_role; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_role IS '角色表';


--
-- Name: COLUMN sys_role.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.name IS '角色名称';


--
-- Name: COLUMN sys_role.code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.code IS '角色编码';


--
-- Name: COLUMN sys_role."order"; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role."order" IS '显示排序';


--
-- Name: COLUMN sys_role.data_scope; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.data_scope IS '数据权限范围(1:仅本人 2:本部门 3:本部门及以下 4:全部 5:自定义)';


--
-- Name: COLUMN sys_role.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.id IS '主键ID';


--
-- Name: COLUMN sys_role.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_role.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_role.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.description IS '备注/描述';


--
-- Name: COLUMN sys_role.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.created_time IS '创建时间';


--
-- Name: COLUMN sys_role.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role.updated_time IS '更新时间';


--
-- Name: sys_role_depts; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_role_depts (
    role_id integer NOT NULL,
    dept_id integer NOT NULL
);


ALTER TABLE public.sys_role_depts OWNER TO admin;

--
-- Name: TABLE sys_role_depts; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_role_depts IS '角色部门关联表';


--
-- Name: COLUMN sys_role_depts.role_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role_depts.role_id IS '角色ID';


--
-- Name: COLUMN sys_role_depts.dept_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role_depts.dept_id IS '部门ID';


--
-- Name: sys_role_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_role_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_role_id_seq OWNER TO admin;

--
-- Name: sys_role_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_role_id_seq OWNED BY public.sys_role.id;


--
-- Name: sys_role_menus; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_role_menus (
    role_id integer NOT NULL,
    menu_id integer NOT NULL
);


ALTER TABLE public.sys_role_menus OWNER TO admin;

--
-- Name: TABLE sys_role_menus; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_role_menus IS '角色菜单关联表';


--
-- Name: COLUMN sys_role_menus.role_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role_menus.role_id IS '角色ID';


--
-- Name: COLUMN sys_role_menus.menu_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_role_menus.menu_id IS '菜单ID';


--
-- Name: sys_tenant; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_tenant (
    name character varying(100) NOT NULL,
    code character varying(100) NOT NULL,
    start_time timestamp without time zone,
    end_time timestamp without time zone,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.sys_tenant OWNER TO admin;

--
-- Name: TABLE sys_tenant; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_tenant IS '租户表';


--
-- Name: COLUMN sys_tenant.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.name IS '租户名称';


--
-- Name: COLUMN sys_tenant.code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.code IS '租户编码';


--
-- Name: COLUMN sys_tenant.start_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.start_time IS '开始时间';


--
-- Name: COLUMN sys_tenant.end_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.end_time IS '结束时间';


--
-- Name: COLUMN sys_tenant.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.id IS '主键ID';


--
-- Name: COLUMN sys_tenant.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_tenant.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_tenant.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.description IS '备注/描述';


--
-- Name: COLUMN sys_tenant.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.created_time IS '创建时间';


--
-- Name: COLUMN sys_tenant.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant.updated_time IS '更新时间';


--
-- Name: sys_tenant_api_key; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_tenant_api_key (
    api_key character varying(256) NOT NULL,
    api_secret character varying(256) NOT NULL,
    expired_at timestamp without time zone,
    last_used_at timestamp without time zone,
    tenant_id integer NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    return_url character varying(512)
);


ALTER TABLE public.sys_tenant_api_key OWNER TO admin;

--
-- Name: COLUMN sys_tenant_api_key.api_key; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.api_key IS 'API Key';


--
-- Name: COLUMN sys_tenant_api_key.api_secret; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.api_secret IS 'API Secret';


--
-- Name: COLUMN sys_tenant_api_key.expired_at; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.expired_at IS '过期时间';


--
-- Name: COLUMN sys_tenant_api_key.last_used_at; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.last_used_at IS '最后使用时间';


--
-- Name: COLUMN sys_tenant_api_key.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.tenant_id IS '租户ID';


--
-- Name: COLUMN sys_tenant_api_key.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.id IS '主键ID';


--
-- Name: COLUMN sys_tenant_api_key.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_tenant_api_key.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_tenant_api_key.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.description IS '备注/描述';


--
-- Name: COLUMN sys_tenant_api_key.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.created_time IS '创建时间';


--
-- Name: COLUMN sys_tenant_api_key.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.updated_time IS '更新时间';


--
-- Name: COLUMN sys_tenant_api_key.return_url; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_key.return_url IS '同步返回地址';


--
-- Name: sys_tenant_api_key_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_tenant_api_key_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_tenant_api_key_id_seq OWNER TO admin;

--
-- Name: sys_tenant_api_key_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_tenant_api_key_id_seq OWNED BY public.sys_tenant_api_key.id;


--
-- Name: sys_tenant_api_log; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_tenant_api_log (
    api_key_id integer,
    endpoint character varying(256) NOT NULL,
    method character varying(10) NOT NULL,
    request_ip character varying(50) NOT NULL,
    request_data text,
    response_code integer NOT NULL,
    response_time integer NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL
);


ALTER TABLE public.sys_tenant_api_log OWNER TO admin;

--
-- Name: COLUMN sys_tenant_api_log.api_key_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.api_key_id IS 'API Key ID';


--
-- Name: COLUMN sys_tenant_api_log.endpoint; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.endpoint IS '调用的接口';


--
-- Name: COLUMN sys_tenant_api_log.method; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.method IS '请求方法';


--
-- Name: COLUMN sys_tenant_api_log.request_ip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.request_ip IS '请求IP';


--
-- Name: COLUMN sys_tenant_api_log.request_data; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.request_data IS '请求数据（脱敏存储）';


--
-- Name: COLUMN sys_tenant_api_log.response_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.response_code IS '响应码';


--
-- Name: COLUMN sys_tenant_api_log.response_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.response_time IS '响应时间（毫秒）';


--
-- Name: COLUMN sys_tenant_api_log.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.id IS '主键ID';


--
-- Name: COLUMN sys_tenant_api_log.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_tenant_api_log.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_tenant_api_log.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.description IS '备注/描述';


--
-- Name: COLUMN sys_tenant_api_log.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.created_time IS '创建时间';


--
-- Name: COLUMN sys_tenant_api_log.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.updated_time IS '更新时间';


--
-- Name: COLUMN sys_tenant_api_log.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_tenant_api_log.tenant_id IS '租户ID';


--
-- Name: sys_tenant_api_log_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_tenant_api_log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_tenant_api_log_id_seq OWNER TO admin;

--
-- Name: sys_tenant_api_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_tenant_api_log_id_seq OWNED BY public.sys_tenant_api_log.id;


--
-- Name: sys_tenant_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_tenant_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_tenant_id_seq OWNER TO admin;

--
-- Name: sys_tenant_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_tenant_id_seq OWNED BY public.sys_tenant.id;


--
-- Name: sys_user; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_user (
    username character varying(64) NOT NULL,
    password character varying(255) NOT NULL,
    name character varying(32) NOT NULL,
    mobile character varying(11),
    email character varying(64),
    gender character varying(1),
    avatar character varying(255),
    is_superuser boolean NOT NULL,
    last_login timestamp with time zone,
    gitee_login character varying(32),
    github_login character varying(32),
    wx_login character varying(32),
    qq_login character varying(32),
    dept_id integer,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    tenant_id integer NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.sys_user OWNER TO admin;

--
-- Name: TABLE sys_user; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_user IS '用户表';


--
-- Name: COLUMN sys_user.username; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.username IS '用户名/登录账号';


--
-- Name: COLUMN sys_user.password; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.password IS '密码哈希';


--
-- Name: COLUMN sys_user.name; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN sys_user.mobile; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN sys_user.email; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN sys_user.gender; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.gender IS '性别(0:男 1:女 2:未知)';


--
-- Name: COLUMN sys_user.avatar; Type: COMMENT; Schema: public; Owner: admin
--

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


--
-- Name: COLUMN sys_user.is_superuser; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.is_superuser IS '是否超管';


--
-- Name: COLUMN sys_user.last_login; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.last_login IS '最后登录时间';


--
-- Name: COLUMN sys_user.gitee_login; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.gitee_login IS 'Gitee登录';


--
-- Name: COLUMN sys_user.github_login; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.github_login IS 'Github登录';


--
-- Name: COLUMN sys_user.wx_login; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.wx_login IS '微信登录';


--
-- Name: COLUMN sys_user.qq_login; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.qq_login IS 'QQ登录';


--
-- Name: COLUMN sys_user.dept_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.dept_id IS '部门ID';


--
-- Name: COLUMN sys_user.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.id IS '主键ID';


--
-- Name: COLUMN sys_user.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN sys_user.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN sys_user.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.description IS '备注/描述';


--
-- Name: COLUMN sys_user.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.created_time IS '创建时间';


--
-- Name: COLUMN sys_user.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.updated_time IS '更新时间';


--
-- Name: COLUMN sys_user.tenant_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.tenant_id IS '租户ID';


--
-- Name: COLUMN sys_user.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.created_id IS '创建人ID';


--
-- Name: COLUMN sys_user.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user.updated_id IS '更新人ID';


--
-- Name: sys_user_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.sys_user_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.sys_user_id_seq OWNER TO admin;

--
-- Name: sys_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.sys_user_id_seq OWNED BY public.sys_user.id;


--
-- Name: sys_user_positions; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_user_positions (
    user_id integer NOT NULL,
    position_id integer NOT NULL
);


ALTER TABLE public.sys_user_positions OWNER TO admin;

--
-- Name: TABLE sys_user_positions; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_user_positions IS '用户岗位关联表';


--
-- Name: COLUMN sys_user_positions.user_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user_positions.user_id IS '用户ID';


--
-- Name: COLUMN sys_user_positions.position_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user_positions.position_id IS '岗位ID';


--
-- Name: sys_user_roles; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.sys_user_roles (
    user_id integer NOT NULL,
    role_id integer NOT NULL
);


ALTER TABLE public.sys_user_roles OWNER TO admin;

--
-- Name: TABLE sys_user_roles; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.sys_user_roles IS '用户角色关联表';


--
-- Name: COLUMN sys_user_roles.user_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user_roles.user_id IS '用户ID';


--
-- Name: COLUMN sys_user_roles.role_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.sys_user_roles.role_id IS '角色ID';


--
-- Name: task_job; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.task_job (
    job_id character varying(64) NOT NULL,
    job_name character varying(128),
    trigger_type character varying(32),
    status character varying(16) NOT NULL,
    next_run_time character varying(64),
    job_state text,
    result text,
    error text,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL
);


ALTER TABLE public.task_job OWNER TO admin;

--
-- Name: TABLE task_job; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.task_job IS '任务执行日志表';


--
-- Name: COLUMN task_job.job_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.job_id IS '任务ID';


--
-- Name: COLUMN task_job.job_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.job_name IS '任务名称';


--
-- Name: COLUMN task_job.trigger_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.trigger_type IS '触发方式: cron/interval/date/manual';


--
-- Name: COLUMN task_job.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.status IS '执行状态';


--
-- Name: COLUMN task_job.next_run_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.next_run_time IS '下次执行时间';


--
-- Name: COLUMN task_job.job_state; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.job_state IS '任务状态信息';


--
-- Name: COLUMN task_job.result; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.result IS '执行结果';


--
-- Name: COLUMN task_job.error; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.error IS '错误信息';


--
-- Name: COLUMN task_job.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.id IS '主键ID';


--
-- Name: COLUMN task_job.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN task_job.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.description IS '备注/描述';


--
-- Name: COLUMN task_job.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.created_time IS '创建时间';


--
-- Name: COLUMN task_job.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_job.updated_time IS '更新时间';


--
-- Name: task_job_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.task_job_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.task_job_id_seq OWNER TO admin;

--
-- Name: task_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.task_job_id_seq OWNED BY public.task_job.id;


--
-- Name: task_node; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.task_node (
    name character varying(64) NOT NULL,
    code character varying(32) NOT NULL,
    jobstore character varying(64),
    executor character varying(64),
    trigger character varying(64),
    trigger_args text,
    func text,
    args text,
    kwargs text,
    "coalesce" boolean,
    max_instances integer,
    start_date character varying(64),
    end_date character varying(64),
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.task_node OWNER TO admin;

--
-- Name: TABLE task_node; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.task_node IS '节点类型表';


--
-- Name: COLUMN task_node.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.name IS '节点名称';


--
-- Name: COLUMN task_node.code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.code IS '节点编码';


--
-- Name: COLUMN task_node.jobstore; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.jobstore IS '存储器';


--
-- Name: COLUMN task_node.executor; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.executor IS '执行器';


--
-- Name: COLUMN task_node.trigger; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.trigger IS '触发器';


--
-- Name: COLUMN task_node.trigger_args; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.trigger_args IS '触发器参数';


--
-- Name: COLUMN task_node.func; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.func IS '代码块';


--
-- Name: COLUMN task_node.args; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.args IS '位置参数';


--
-- Name: COLUMN task_node.kwargs; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.kwargs IS '关键字参数';


--
-- Name: COLUMN task_node."coalesce"; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node."coalesce" IS '是否合并运行';


--
-- Name: COLUMN task_node.max_instances; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.max_instances IS '最大实例数';


--
-- Name: COLUMN task_node.start_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.start_date IS '开始时间';


--
-- Name: COLUMN task_node.end_date; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.end_date IS '结束时间';


--
-- Name: COLUMN task_node.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.id IS '主键ID';


--
-- Name: COLUMN task_node.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN task_node.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN task_node.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.description IS '备注/描述';


--
-- Name: COLUMN task_node.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.created_time IS '创建时间';


--
-- Name: COLUMN task_node.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.updated_time IS '更新时间';


--
-- Name: COLUMN task_node.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.created_id IS '创建人ID';


--
-- Name: COLUMN task_node.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_node.updated_id IS '更新人ID';


--
-- Name: task_node_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.task_node_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.task_node_id_seq OWNER TO admin;

--
-- Name: task_node_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.task_node_id_seq OWNED BY public.task_node.id;


--
-- Name: task_workflow; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.task_workflow (
    name character varying(128) NOT NULL,
    code character varying(64) NOT NULL,
    workflow_status character varying(32) NOT NULL,
    nodes json,
    edges json,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.task_workflow OWNER TO admin;

--
-- Name: TABLE task_workflow; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.task_workflow IS '工作流定义表';


--
-- Name: COLUMN task_workflow.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.name IS '流程名称';


--
-- Name: COLUMN task_workflow.code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.code IS '流程编码';


--
-- Name: COLUMN task_workflow.workflow_status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.workflow_status IS '流程状态: draft/published/archived';


--
-- Name: COLUMN task_workflow.nodes; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.nodes IS 'Vue Flow nodes JSON';


--
-- Name: COLUMN task_workflow.edges; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.edges IS 'Vue Flow edges JSON';


--
-- Name: COLUMN task_workflow.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.id IS '主键ID';


--
-- Name: COLUMN task_workflow.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN task_workflow.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN task_workflow.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.description IS '备注/描述';


--
-- Name: COLUMN task_workflow.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.created_time IS '创建时间';


--
-- Name: COLUMN task_workflow.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.updated_time IS '更新时间';


--
-- Name: COLUMN task_workflow.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.created_id IS '创建人ID';


--
-- Name: COLUMN task_workflow.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow.updated_id IS '更新人ID';


--
-- Name: task_workflow_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.task_workflow_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.task_workflow_id_seq OWNER TO admin;

--
-- Name: task_workflow_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.task_workflow_id_seq OWNED BY public.task_workflow.id;


--
-- Name: task_workflow_node_type; Type: TABLE; Schema: public; Owner: admin
--

CREATE TABLE public.task_workflow_node_type (
    name character varying(128) NOT NULL,
    code character varying(64) NOT NULL,
    category character varying(32) NOT NULL,
    func text NOT NULL,
    args text,
    kwargs text,
    sort_order integer NOT NULL,
    is_active boolean NOT NULL,
    id integer NOT NULL,
    uuid character varying(64) NOT NULL,
    status character varying(10) NOT NULL,
    description text,
    created_time timestamp without time zone NOT NULL,
    updated_time timestamp without time zone NOT NULL,
    created_id integer,
    updated_id integer
);


ALTER TABLE public.task_workflow_node_type OWNER TO admin;

--
-- Name: TABLE task_workflow_node_type; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE public.task_workflow_node_type IS '工作流编排节点类型（非定时任务节点）';


--
-- Name: COLUMN task_workflow_node_type.name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.name IS '显示名称';


--
-- Name: COLUMN task_workflow_node_type.code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.code IS '节点编码，对应画布 node.type';


--
-- Name: COLUMN task_workflow_node_type.category; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.category IS '分类: trigger/action/condition/control';


--
-- Name: COLUMN task_workflow_node_type.func; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.func IS 'Python 代码块，须定义 handler(*args,**kwargs)';


--
-- Name: COLUMN task_workflow_node_type.args; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.args IS '默认位置参数，逗号分隔';


--
-- Name: COLUMN task_workflow_node_type.kwargs; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.kwargs IS '默认关键字参数 JSON';


--
-- Name: COLUMN task_workflow_node_type.sort_order; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.sort_order IS '排序';


--
-- Name: COLUMN task_workflow_node_type.is_active; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.is_active IS '是否启用';


--
-- Name: COLUMN task_workflow_node_type.id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.id IS '主键ID';


--
-- Name: COLUMN task_workflow_node_type.uuid; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.uuid IS 'UUID全局唯一标识';


--
-- Name: COLUMN task_workflow_node_type.status; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.status IS '状态(0:正常 1:禁用)';


--
-- Name: COLUMN task_workflow_node_type.description; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.description IS '备注/描述';


--
-- Name: COLUMN task_workflow_node_type.created_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.created_time IS '创建时间';


--
-- Name: COLUMN task_workflow_node_type.updated_time; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.updated_time IS '更新时间';


--
-- Name: COLUMN task_workflow_node_type.created_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.created_id IS '创建人ID';


--
-- Name: COLUMN task_workflow_node_type.updated_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN public.task_workflow_node_type.updated_id IS '更新人ID';


--
-- Name: task_workflow_node_type_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

CREATE SEQUENCE public.task_workflow_node_type_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.task_workflow_node_type_id_seq OWNER TO admin;

--
-- Name: task_workflow_node_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE public.task_workflow_node_type_id_seq OWNED BY public.task_workflow_node_type.id;


--
-- Name: app_portal id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: gen_demo id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: gen_demo01 id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: gen_table id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: gen_table_column id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: open_conf id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: open_transfer id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_account id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_alipay_notify_log id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_bill id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_bill_order id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_bill_voucher id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_department id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_deposit id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_employee id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_enterprise id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_expense_institution id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_expense_issue_batch id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_expense_quota id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_expense_quota_change_log id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_expense_rule id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_facetoface_order id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_points id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_points_record id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_service_provider id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_service_provider_profile id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_transfer id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: pay_withdraw id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_dept id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_dict_data id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_dict_type id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_invitation_code id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_log id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_menu id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_notice id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_param id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_position id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_role id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_tenant id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_tenant_api_key id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_tenant_api_log id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: sys_user id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: task_job id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: task_node id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: task_workflow id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: task_workflow_node_type id; Type: DEFAULT; Schema: public; Owner: admin
--

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


--
-- Name: app_portal app_portal_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.app_portal
    ADD CONSTRAINT app_portal_pkey PRIMARY KEY (id);


--
-- Name: apscheduler_jobs apscheduler_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.apscheduler_jobs
    ADD CONSTRAINT apscheduler_jobs_pkey PRIMARY KEY (id);


--
-- Name: gen_demo01 gen_demo01_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_demo01
    ADD CONSTRAINT gen_demo01_pkey PRIMARY KEY (id);


--
-- Name: gen_demo gen_demo_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_demo
    ADD CONSTRAINT gen_demo_pkey PRIMARY KEY (id);


--
-- Name: gen_table_column gen_table_column_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table_column
    ADD CONSTRAINT gen_table_column_pkey PRIMARY KEY (id);


--
-- Name: gen_table gen_table_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table
    ADD CONSTRAINT gen_table_pkey PRIMARY KEY (id);


--
-- Name: open_conf open_conf_app_id_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.open_conf
    ADD CONSTRAINT open_conf_app_id_key UNIQUE (app_id);


--
-- Name: open_conf open_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.open_conf
    ADD CONSTRAINT open_conf_pkey PRIMARY KEY (id);


--
-- Name: open_transfer open_transfer_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.open_transfer
    ADD CONSTRAINT open_transfer_pkey PRIMARY KEY (id);


--
-- Name: pay_account pay_account_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_account
    ADD CONSTRAINT pay_account_pkey PRIMARY KEY (id);


--
-- Name: pay_alipay_notify_log pay_alipay_notify_log_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_alipay_notify_log
    ADD CONSTRAINT pay_alipay_notify_log_pkey PRIMARY KEY (id);


--
-- Name: pay_bill_order pay_bill_order_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_bill_order
    ADD CONSTRAINT pay_bill_order_pkey PRIMARY KEY (id);


--
-- Name: pay_bill pay_bill_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_bill
    ADD CONSTRAINT pay_bill_pkey PRIMARY KEY (id);


--
-- Name: pay_bill_voucher pay_bill_voucher_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_bill_voucher
    ADD CONSTRAINT pay_bill_voucher_pkey PRIMARY KEY (id);


--
-- Name: pay_department pay_department_department_id_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_department
    ADD CONSTRAINT pay_department_department_id_key UNIQUE (department_id);


--
-- Name: pay_department pay_department_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_department
    ADD CONSTRAINT pay_department_pkey PRIMARY KEY (id);


--
-- Name: pay_deposit pay_deposit_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_deposit
    ADD CONSTRAINT pay_deposit_pkey PRIMARY KEY (id);


--
-- Name: pay_employee pay_employee_employee_id_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_employee
    ADD CONSTRAINT pay_employee_employee_id_key UNIQUE (employee_id);


--
-- Name: pay_employee pay_employee_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_employee
    ADD CONSTRAINT pay_employee_pkey PRIMARY KEY (id);


--
-- Name: pay_enterprise pay_enterprise_enterprise_id_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_enterprise
    ADD CONSTRAINT pay_enterprise_enterprise_id_key UNIQUE (enterprise_id);


--
-- Name: pay_enterprise pay_enterprise_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_enterprise
    ADD CONSTRAINT pay_enterprise_pkey PRIMARY KEY (id);


--
-- Name: pay_expense_institution pay_expense_institution_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_institution
    ADD CONSTRAINT pay_expense_institution_pkey PRIMARY KEY (id);


--
-- Name: pay_expense_issue_batch pay_expense_issue_batch_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_issue_batch
    ADD CONSTRAINT pay_expense_issue_batch_pkey PRIMARY KEY (id);


--
-- Name: pay_expense_quota_change_log pay_expense_quota_change_log_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_quota_change_log
    ADD CONSTRAINT pay_expense_quota_change_log_pkey PRIMARY KEY (id);


--
-- Name: pay_expense_quota pay_expense_quota_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_quota
    ADD CONSTRAINT pay_expense_quota_pkey PRIMARY KEY (id);


--
-- Name: pay_expense_rule pay_expense_rule_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_rule
    ADD CONSTRAINT pay_expense_rule_pkey PRIMARY KEY (id);


--
-- Name: pay_facetoface_order pay_facetoface_order_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_facetoface_order
    ADD CONSTRAINT pay_facetoface_order_pkey PRIMARY KEY (id);


--
-- Name: pay_points pay_points_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_points
    ADD CONSTRAINT pay_points_pkey PRIMARY KEY (id);


--
-- Name: pay_points_record pay_points_record_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_points_record
    ADD CONSTRAINT pay_points_record_pkey PRIMARY KEY (id);


--
-- Name: pay_service_provider pay_service_provider_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_service_provider
    ADD CONSTRAINT pay_service_provider_pkey PRIMARY KEY (id);


--
-- Name: pay_service_provider_profile pay_service_provider_profile_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_service_provider_profile
    ADD CONSTRAINT pay_service_provider_profile_pkey PRIMARY KEY (id);


--
-- Name: pay_service_provider_profile pay_service_provider_profile_service_provider_id_biz_type_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_service_provider_profile
    ADD CONSTRAINT pay_service_provider_profile_service_provider_id_biz_type_key UNIQUE (service_provider_id, biz_type);


--
-- Name: pay_transfer pay_transfer_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_transfer
    ADD CONSTRAINT pay_transfer_pkey PRIMARY KEY (id);


--
-- Name: pay_withdraw pay_withdraw_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_withdraw
    ADD CONSTRAINT pay_withdraw_pkey PRIMARY KEY (id);


--
-- Name: sys_dept sys_dept_code_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dept
    ADD CONSTRAINT sys_dept_code_key UNIQUE (code);


--
-- Name: sys_dept sys_dept_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dept
    ADD CONSTRAINT sys_dept_pkey PRIMARY KEY (id);


--
-- Name: sys_dict_data sys_dict_data_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dict_data
    ADD CONSTRAINT sys_dict_data_pkey PRIMARY KEY (id);


--
-- Name: sys_dict_type sys_dict_type_dict_type_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dict_type
    ADD CONSTRAINT sys_dict_type_dict_type_key UNIQUE (dict_type);


--
-- Name: sys_dict_type sys_dict_type_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dict_type
    ADD CONSTRAINT sys_dict_type_pkey PRIMARY KEY (id);


--
-- Name: sys_invitation_code sys_invitation_code_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_invitation_code
    ADD CONSTRAINT sys_invitation_code_pkey PRIMARY KEY (id);


--
-- Name: sys_log sys_log_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_log
    ADD CONSTRAINT sys_log_pkey PRIMARY KEY (id);


--
-- Name: sys_menu sys_menu_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_menu
    ADD CONSTRAINT sys_menu_pkey PRIMARY KEY (id);


--
-- Name: sys_notice sys_notice_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_notice
    ADD CONSTRAINT sys_notice_pkey PRIMARY KEY (id);


--
-- Name: sys_param sys_param_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_param
    ADD CONSTRAINT sys_param_pkey PRIMARY KEY (id);


--
-- Name: sys_position sys_position_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_position
    ADD CONSTRAINT sys_position_pkey PRIMARY KEY (id);


--
-- Name: sys_role sys_role_code_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role
    ADD CONSTRAINT sys_role_code_key UNIQUE (code);


--
-- Name: sys_role_depts sys_role_depts_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role_depts
    ADD CONSTRAINT sys_role_depts_pkey PRIMARY KEY (role_id, dept_id);


--
-- Name: sys_role_menus sys_role_menus_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role_menus
    ADD CONSTRAINT sys_role_menus_pkey PRIMARY KEY (role_id, menu_id);


--
-- Name: sys_role sys_role_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role
    ADD CONSTRAINT sys_role_pkey PRIMARY KEY (id);


--
-- Name: sys_tenant_api_key sys_tenant_api_key_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant_api_key
    ADD CONSTRAINT sys_tenant_api_key_pkey PRIMARY KEY (id);


--
-- Name: sys_tenant_api_log sys_tenant_api_log_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant_api_log
    ADD CONSTRAINT sys_tenant_api_log_pkey PRIMARY KEY (id);


--
-- Name: sys_tenant sys_tenant_code_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant
    ADD CONSTRAINT sys_tenant_code_key UNIQUE (code);


--
-- Name: sys_tenant sys_tenant_name_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant
    ADD CONSTRAINT sys_tenant_name_key UNIQUE (name);


--
-- Name: sys_tenant sys_tenant_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant
    ADD CONSTRAINT sys_tenant_pkey PRIMARY KEY (id);


--
-- Name: sys_user sys_user_email_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_email_key UNIQUE (email);


--
-- Name: sys_user sys_user_mobile_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_mobile_key UNIQUE (mobile);


--
-- Name: sys_user sys_user_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_pkey PRIMARY KEY (id);


--
-- Name: sys_user_positions sys_user_positions_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user_positions
    ADD CONSTRAINT sys_user_positions_pkey PRIMARY KEY (user_id, position_id);


--
-- Name: sys_user_roles sys_user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user_roles
    ADD CONSTRAINT sys_user_roles_pkey PRIMARY KEY (user_id, role_id);


--
-- Name: sys_user sys_user_username_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_username_key UNIQUE (username);


--
-- Name: task_job task_job_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_job
    ADD CONSTRAINT task_job_pkey PRIMARY KEY (id);


--
-- Name: task_node task_node_code_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_node
    ADD CONSTRAINT task_node_code_key UNIQUE (code);


--
-- Name: task_node task_node_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_node
    ADD CONSTRAINT task_node_pkey PRIMARY KEY (id);


--
-- Name: task_workflow_node_type task_workflow_node_type_code_key; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow_node_type
    ADD CONSTRAINT task_workflow_node_type_code_key UNIQUE (code);


--
-- Name: task_workflow_node_type task_workflow_node_type_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow_node_type
    ADD CONSTRAINT task_workflow_node_type_pkey PRIMARY KEY (id);


--
-- Name: task_workflow task_workflow_pkey; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow
    ADD CONSTRAINT task_workflow_pkey PRIMARY KEY (id);


--
-- Name: task_workflow uq_task_workflow_code; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow
    ADD CONSTRAINT uq_task_workflow_code UNIQUE (code);


--
-- Name: open_transfer uq_third_biz_tenant; Type: CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.open_transfer
    ADD CONSTRAINT uq_third_biz_tenant UNIQUE (third_biz_no, tenant_id);


--
-- Name: idx_invitation_code; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX idx_invitation_code ON public.sys_invitation_code USING btree (code);


--
-- Name: idx_transfer_retry; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX idx_transfer_retry ON public.pay_transfer USING btree (next_retry_at) WHERE (((status)::text = 'DEALING'::text) AND (retry_count < 4));


--
-- Name: idx_transfer_stat; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX idx_transfer_stat ON public.pay_transfer USING btree (status, created_time, amount);


--
-- Name: ix_app_portal_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_created_id ON public.app_portal USING btree (created_id);


--
-- Name: ix_app_portal_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_created_time ON public.app_portal USING btree (created_time);


--
-- Name: ix_app_portal_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_id ON public.app_portal USING btree (id);


--
-- Name: ix_app_portal_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_status ON public.app_portal USING btree (status);


--
-- Name: ix_app_portal_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_tenant_id ON public.app_portal USING btree (tenant_id);


--
-- Name: ix_app_portal_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_updated_id ON public.app_portal USING btree (updated_id);


--
-- Name: ix_app_portal_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_app_portal_updated_time ON public.app_portal USING btree (updated_time);


--
-- Name: ix_app_portal_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_app_portal_uuid ON public.app_portal USING btree (uuid);


--
-- Name: ix_apscheduler_jobs_next_run_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_apscheduler_jobs_next_run_time ON public.apscheduler_jobs USING btree (next_run_time);


--
-- Name: ix_gen_demo01_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo01_created_id ON public.gen_demo01 USING btree (created_id);


--
-- Name: ix_gen_demo01_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo01_created_time ON public.gen_demo01 USING btree (created_time);


--
-- Name: ix_gen_demo01_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo01_id ON public.gen_demo01 USING btree (id);


--
-- Name: ix_gen_demo01_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo01_status ON public.gen_demo01 USING btree (status);


--
-- Name: ix_gen_demo01_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo01_updated_id ON public.gen_demo01 USING btree (updated_id);


--
-- Name: ix_gen_demo01_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo01_updated_time ON public.gen_demo01 USING btree (updated_time);


--
-- Name: ix_gen_demo01_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_gen_demo01_uuid ON public.gen_demo01 USING btree (uuid);


--
-- Name: ix_gen_demo_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo_created_id ON public.gen_demo USING btree (created_id);


--
-- Name: ix_gen_demo_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo_created_time ON public.gen_demo USING btree (created_time);


--
-- Name: ix_gen_demo_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo_id ON public.gen_demo USING btree (id);


--
-- Name: ix_gen_demo_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo_status ON public.gen_demo USING btree (status);


--
-- Name: ix_gen_demo_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo_updated_id ON public.gen_demo USING btree (updated_id);


--
-- Name: ix_gen_demo_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_demo_updated_time ON public.gen_demo USING btree (updated_time);


--
-- Name: ix_gen_demo_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_gen_demo_uuid ON public.gen_demo USING btree (uuid);


--
-- Name: ix_gen_table_column_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_created_id ON public.gen_table_column USING btree (created_id);


--
-- Name: ix_gen_table_column_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_created_time ON public.gen_table_column USING btree (created_time);


--
-- Name: ix_gen_table_column_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_id ON public.gen_table_column USING btree (id);


--
-- Name: ix_gen_table_column_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_status ON public.gen_table_column USING btree (status);


--
-- Name: ix_gen_table_column_table_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_table_id ON public.gen_table_column USING btree (table_id);


--
-- Name: ix_gen_table_column_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_updated_id ON public.gen_table_column USING btree (updated_id);


--
-- Name: ix_gen_table_column_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_column_updated_time ON public.gen_table_column USING btree (updated_time);


--
-- Name: ix_gen_table_column_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_gen_table_column_uuid ON public.gen_table_column USING btree (uuid);


--
-- Name: ix_gen_table_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_created_id ON public.gen_table USING btree (created_id);


--
-- Name: ix_gen_table_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_created_time ON public.gen_table USING btree (created_time);


--
-- Name: ix_gen_table_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_id ON public.gen_table USING btree (id);


--
-- Name: ix_gen_table_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_status ON public.gen_table USING btree (status);


--
-- Name: ix_gen_table_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_updated_id ON public.gen_table USING btree (updated_id);


--
-- Name: ix_gen_table_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_gen_table_updated_time ON public.gen_table USING btree (updated_time);


--
-- Name: ix_gen_table_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_gen_table_uuid ON public.gen_table USING btree (uuid);


--
-- Name: ix_open_conf_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_conf_created_time ON public.open_conf USING btree (created_time);


--
-- Name: ix_open_conf_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_conf_id ON public.open_conf USING btree (id);


--
-- Name: ix_open_conf_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_conf_tenant_id ON public.open_conf USING btree (tenant_id);


--
-- Name: ix_open_conf_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_conf_updated_time ON public.open_conf USING btree (updated_time);


--
-- Name: ix_open_transfer_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_created_time ON public.open_transfer USING btree (created_time);


--
-- Name: ix_open_transfer_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_enterprise_id ON public.open_transfer USING btree (enterprise_id);


--
-- Name: ix_open_transfer_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_id ON public.open_transfer USING btree (id);


--
-- Name: ix_open_transfer_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_out_biz_no ON public.open_transfer USING btree (out_biz_no);


--
-- Name: ix_open_transfer_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_status ON public.open_transfer USING btree (status);


--
-- Name: ix_open_transfer_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_tenant_id ON public.open_transfer USING btree (tenant_id);


--
-- Name: ix_open_transfer_third_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_third_biz_no ON public.open_transfer USING btree (third_biz_no);


--
-- Name: ix_open_transfer_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_open_transfer_updated_time ON public.open_transfer USING btree (updated_time);


--
-- Name: ix_pay_account_account_book_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_account_account_book_id ON public.pay_account USING btree (account_book_id);


--
-- Name: ix_pay_account_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_account_created_time ON public.pay_account USING btree (created_time);


--
-- Name: ix_pay_account_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_account_enterprise_id ON public.pay_account USING btree (enterprise_id);


--
-- Name: ix_pay_account_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_account_id ON public.pay_account USING btree (id);


--
-- Name: ix_pay_account_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_account_tenant_id ON public.pay_account USING btree (tenant_id);


--
-- Name: ix_pay_account_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_account_updated_time ON public.pay_account USING btree (updated_time);


--
-- Name: ix_pay_alipay_notify_log_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_alipay_notify_log_created_time ON public.pay_alipay_notify_log USING btree (created_time);


--
-- Name: ix_pay_alipay_notify_log_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_alipay_notify_log_id ON public.pay_alipay_notify_log USING btree (id);


--
-- Name: ix_pay_alipay_notify_log_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_alipay_notify_log_status ON public.pay_alipay_notify_log USING btree (status);


--
-- Name: ix_pay_alipay_notify_log_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_alipay_notify_log_updated_time ON public.pay_alipay_notify_log USING btree (updated_time);


--
-- Name: ix_pay_bill_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_created_time ON public.pay_bill USING btree (created_time);


--
-- Name: ix_pay_bill_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_enterprise_id ON public.pay_bill USING btree (enterprise_id);


--
-- Name: ix_pay_bill_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_id ON public.pay_bill USING btree (id);


--
-- Name: ix_pay_bill_order_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_created_time ON public.pay_bill_order USING btree (created_time);


--
-- Name: ix_pay_bill_order_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_enterprise_id ON public.pay_bill_order USING btree (enterprise_id);


--
-- Name: ix_pay_bill_order_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_id ON public.pay_bill_order USING btree (id);


--
-- Name: ix_pay_bill_order_order_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_bill_order_order_no ON public.pay_bill_order USING btree (order_no);


--
-- Name: ix_pay_bill_order_pay_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_pay_no ON public.pay_bill_order USING btree (pay_no);


--
-- Name: ix_pay_bill_order_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_status ON public.pay_bill_order USING btree (status);


--
-- Name: ix_pay_bill_order_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_tenant_id ON public.pay_bill_order USING btree (tenant_id);


--
-- Name: ix_pay_bill_order_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_order_updated_time ON public.pay_bill_order USING btree (updated_time);


--
-- Name: ix_pay_bill_pay_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_bill_pay_no ON public.pay_bill USING btree (pay_no);


--
-- Name: ix_pay_bill_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_tenant_id ON public.pay_bill USING btree (tenant_id);


--
-- Name: ix_pay_bill_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_updated_time ON public.pay_bill USING btree (updated_time);


--
-- Name: ix_pay_bill_voucher_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_created_time ON public.pay_bill_voucher USING btree (created_time);


--
-- Name: ix_pay_bill_voucher_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_enterprise_id ON public.pay_bill_voucher USING btree (enterprise_id);


--
-- Name: ix_pay_bill_voucher_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_id ON public.pay_bill_voucher USING btree (id);


--
-- Name: ix_pay_bill_voucher_pay_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_pay_no ON public.pay_bill_voucher USING btree (pay_no);


--
-- Name: ix_pay_bill_voucher_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_status ON public.pay_bill_voucher USING btree (status);


--
-- Name: ix_pay_bill_voucher_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_tenant_id ON public.pay_bill_voucher USING btree (tenant_id);


--
-- Name: ix_pay_bill_voucher_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_updated_time ON public.pay_bill_voucher USING btree (updated_time);


--
-- Name: ix_pay_bill_voucher_voucher_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_bill_voucher_voucher_id ON public.pay_bill_voucher USING btree (voucher_id);


--
-- Name: ix_pay_department_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_department_enterprise_id ON public.pay_department USING btree (enterprise_id);


--
-- Name: ix_pay_department_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_department_id ON public.pay_department USING btree (id);


--
-- Name: ix_pay_department_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_department_tenant_id ON public.pay_department USING btree (tenant_id);


--
-- Name: ix_pay_deposit_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_deposit_created_time ON public.pay_deposit USING btree (created_time);


--
-- Name: ix_pay_deposit_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_deposit_enterprise_id ON public.pay_deposit USING btree (enterprise_id);


--
-- Name: ix_pay_deposit_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_deposit_id ON public.pay_deposit USING btree (id);


--
-- Name: ix_pay_deposit_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_deposit_out_biz_no ON public.pay_deposit USING btree (out_biz_no);


--
-- Name: ix_pay_deposit_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_deposit_tenant_id ON public.pay_deposit USING btree (tenant_id);


--
-- Name: ix_pay_deposit_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_deposit_updated_time ON public.pay_deposit USING btree (updated_time);


--
-- Name: ix_pay_employee_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_employee_created_time ON public.pay_employee USING btree (created_time);


--
-- Name: ix_pay_employee_employee_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_employee_employee_no ON public.pay_employee USING btree (employee_no);


--
-- Name: ix_pay_employee_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_employee_enterprise_id ON public.pay_employee USING btree (enterprise_id);


--
-- Name: ix_pay_employee_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_employee_id ON public.pay_employee USING btree (id);


--
-- Name: ix_pay_employee_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_employee_tenant_id ON public.pay_employee USING btree (tenant_id);


--
-- Name: ix_pay_employee_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_employee_updated_time ON public.pay_employee USING btree (updated_time);


--
-- Name: ix_pay_enterprise_account_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_enterprise_account_id ON public.pay_enterprise USING btree (account_id);


--
-- Name: ix_pay_enterprise_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_enterprise_created_time ON public.pay_enterprise USING btree (created_time);


--
-- Name: ix_pay_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_enterprise_id ON public.pay_enterprise USING btree (id);


--
-- Name: ix_pay_enterprise_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_enterprise_out_biz_no ON public.pay_enterprise USING btree (out_biz_no);


--
-- Name: ix_pay_enterprise_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_enterprise_tenant_id ON public.pay_enterprise USING btree (tenant_id);


--
-- Name: ix_pay_enterprise_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_enterprise_updated_time ON public.pay_enterprise USING btree (updated_time);


--
-- Name: ix_pay_expense_institution_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_institution_created_time ON public.pay_expense_institution USING btree (created_time);


--
-- Name: ix_pay_expense_institution_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_institution_enterprise_id ON public.pay_expense_institution USING btree (enterprise_id);


--
-- Name: ix_pay_expense_institution_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_institution_id ON public.pay_expense_institution USING btree (id);


--
-- Name: ix_pay_expense_institution_institution_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_expense_institution_institution_id ON public.pay_expense_institution USING btree (institution_id);


--
-- Name: ix_pay_expense_institution_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_institution_tenant_id ON public.pay_expense_institution USING btree (tenant_id);


--
-- Name: ix_pay_expense_institution_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_institution_updated_time ON public.pay_expense_institution USING btree (updated_time);


--
-- Name: ix_pay_expense_issue_batch_batch_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_expense_issue_batch_batch_no ON public.pay_expense_issue_batch USING btree (batch_no);


--
-- Name: ix_pay_expense_issue_batch_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_issue_batch_created_time ON public.pay_expense_issue_batch USING btree (created_time);


--
-- Name: ix_pay_expense_issue_batch_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_issue_batch_enterprise_id ON public.pay_expense_issue_batch USING btree (enterprise_id);


--
-- Name: ix_pay_expense_issue_batch_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_issue_batch_id ON public.pay_expense_issue_batch USING btree (id);


--
-- Name: ix_pay_expense_issue_batch_institution_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_issue_batch_institution_id ON public.pay_expense_issue_batch USING btree (institution_id);


--
-- Name: ix_pay_expense_issue_batch_issue_batch_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_expense_issue_batch_issue_batch_id ON public.pay_expense_issue_batch USING btree (issue_batch_id);


--
-- Name: ix_pay_expense_issue_batch_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_issue_batch_tenant_id ON public.pay_expense_issue_batch USING btree (tenant_id);


--
-- Name: ix_pay_expense_issue_batch_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_issue_batch_updated_time ON public.pay_expense_issue_batch USING btree (updated_time);


--
-- Name: ix_pay_expense_quota_change_log_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_created_time ON public.pay_expense_quota_change_log USING btree (created_time);


--
-- Name: ix_pay_expense_quota_change_log_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_enterprise_id ON public.pay_expense_quota_change_log USING btree (enterprise_id);


--
-- Name: ix_pay_expense_quota_change_log_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_id ON public.pay_expense_quota_change_log USING btree (id);


--
-- Name: ix_pay_expense_quota_change_log_quota_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_quota_id ON public.pay_expense_quota_change_log USING btree (quota_id);


--
-- Name: ix_pay_expense_quota_change_log_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_status ON public.pay_expense_quota_change_log USING btree (status);


--
-- Name: ix_pay_expense_quota_change_log_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_tenant_id ON public.pay_expense_quota_change_log USING btree (tenant_id);


--
-- Name: ix_pay_expense_quota_change_log_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_change_log_updated_time ON public.pay_expense_quota_change_log USING btree (updated_time);


--
-- Name: ix_pay_expense_quota_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_created_time ON public.pay_expense_quota USING btree (created_time);


--
-- Name: ix_pay_expense_quota_employee_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_employee_id ON public.pay_expense_quota USING btree (employee_id);


--
-- Name: ix_pay_expense_quota_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_enterprise_id ON public.pay_expense_quota USING btree (enterprise_id);


--
-- Name: ix_pay_expense_quota_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_id ON public.pay_expense_quota USING btree (id);


--
-- Name: ix_pay_expense_quota_institution_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_institution_id ON public.pay_expense_quota USING btree (institution_id);


--
-- Name: ix_pay_expense_quota_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_expense_quota_out_biz_no ON public.pay_expense_quota USING btree (out_biz_no);


--
-- Name: ix_pay_expense_quota_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_tenant_id ON public.pay_expense_quota USING btree (tenant_id);


--
-- Name: ix_pay_expense_quota_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_quota_updated_time ON public.pay_expense_quota USING btree (updated_time);


--
-- Name: ix_pay_expense_rule_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_rule_created_time ON public.pay_expense_rule USING btree (created_time);


--
-- Name: ix_pay_expense_rule_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_rule_enterprise_id ON public.pay_expense_rule USING btree (enterprise_id);


--
-- Name: ix_pay_expense_rule_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_rule_id ON public.pay_expense_rule USING btree (id);


--
-- Name: ix_pay_expense_rule_institution_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_rule_institution_id ON public.pay_expense_rule USING btree (institution_id);


--
-- Name: ix_pay_expense_rule_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_expense_rule_out_biz_no ON public.pay_expense_rule USING btree (out_biz_no);


--
-- Name: ix_pay_expense_rule_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_rule_tenant_id ON public.pay_expense_rule USING btree (tenant_id);


--
-- Name: ix_pay_expense_rule_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_expense_rule_updated_time ON public.pay_expense_rule USING btree (updated_time);


--
-- Name: ix_pay_facetoface_order_batch_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_facetoface_order_batch_no ON public.pay_facetoface_order USING btree (batch_no);


--
-- Name: ix_pay_facetoface_order_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_created_time ON public.pay_facetoface_order USING btree (created_time);


--
-- Name: ix_pay_facetoface_order_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_facetoface_order_enterprise_id ON public.pay_facetoface_order USING btree (enterprise_id);


--
-- Name: ix_pay_facetoface_order_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_id ON public.pay_facetoface_order USING btree (id);


--
-- Name: ix_pay_facetoface_order_next_query_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_next_query_time ON public.pay_facetoface_order USING btree (next_query_time);


--
-- Name: ix_pay_facetoface_order_order_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_order_no ON public.pay_facetoface_order USING btree (order_no);


--
-- Name: ix_pay_facetoface_order_order_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_order_status ON public.pay_facetoface_order USING btree (order_status);


--
-- Name: ix_pay_facetoface_order_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_status ON public.pay_facetoface_order USING btree (status);


--
-- Name: ix_pay_facetoface_order_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_tenant_id ON public.pay_facetoface_order USING btree (tenant_id);


--
-- Name: ix_pay_facetoface_order_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_facetoface_order_updated_time ON public.pay_facetoface_order USING btree (updated_time);


--
-- Name: ix_pay_points_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_created_time ON public.pay_points USING btree (created_time);


--
-- Name: ix_pay_points_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_id ON public.pay_points USING btree (id);


--
-- Name: ix_pay_points_record_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_created_time ON public.pay_points_record USING btree (created_time);


--
-- Name: ix_pay_points_record_employee_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_employee_id ON public.pay_points_record USING btree (employee_id);


--
-- Name: ix_pay_points_record_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_enterprise_id ON public.pay_points_record USING btree (enterprise_id);


--
-- Name: ix_pay_points_record_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_id ON public.pay_points_record USING btree (id);


--
-- Name: ix_pay_points_record_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_status ON public.pay_points_record USING btree (status);


--
-- Name: ix_pay_points_record_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_tenant_id ON public.pay_points_record USING btree (tenant_id);


--
-- Name: ix_pay_points_record_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_record_updated_time ON public.pay_points_record USING btree (updated_time);


--
-- Name: ix_pay_points_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_tenant_id ON public.pay_points USING btree (tenant_id);


--
-- Name: ix_pay_points_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_points_updated_time ON public.pay_points USING btree (updated_time);


--
-- Name: ix_pay_transfer_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_transfer_created_time ON public.pay_transfer USING btree (created_time);


--
-- Name: ix_pay_transfer_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_transfer_enterprise_id ON public.pay_transfer USING btree (enterprise_id);


--
-- Name: ix_pay_transfer_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_transfer_id ON public.pay_transfer USING btree (id);


--
-- Name: ix_pay_transfer_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_transfer_out_biz_no ON public.pay_transfer USING btree (out_biz_no);


--
-- Name: ix_pay_transfer_payee_type; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_transfer_payee_type ON public.pay_transfer USING btree (payee_type);


--
-- Name: ix_pay_transfer_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_transfer_tenant_id ON public.pay_transfer USING btree (tenant_id);


--
-- Name: ix_pay_transfer_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_transfer_updated_time ON public.pay_transfer USING btree (updated_time);


--
-- Name: ix_pay_withdraw_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_withdraw_created_time ON public.pay_withdraw USING btree (created_time);


--
-- Name: ix_pay_withdraw_enterprise_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_withdraw_enterprise_id ON public.pay_withdraw USING btree (enterprise_id);


--
-- Name: ix_pay_withdraw_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_withdraw_id ON public.pay_withdraw USING btree (id);


--
-- Name: ix_pay_withdraw_out_biz_no; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_pay_withdraw_out_biz_no ON public.pay_withdraw USING btree (out_biz_no);


--
-- Name: ix_pay_withdraw_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_withdraw_tenant_id ON public.pay_withdraw USING btree (tenant_id);


--
-- Name: ix_pay_withdraw_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_pay_withdraw_updated_time ON public.pay_withdraw USING btree (updated_time);


--
-- Name: ix_sys_dept_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dept_created_time ON public.sys_dept USING btree (created_time);


--
-- Name: ix_sys_dept_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dept_id ON public.sys_dept USING btree (id);


--
-- Name: ix_sys_dept_parent_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dept_parent_id ON public.sys_dept USING btree (parent_id);


--
-- Name: ix_sys_dept_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dept_status ON public.sys_dept USING btree (status);


--
-- Name: ix_sys_dept_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dept_updated_time ON public.sys_dept USING btree (updated_time);


--
-- Name: ix_sys_dept_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_dept_uuid ON public.sys_dept USING btree (uuid);


--
-- Name: ix_sys_dict_data_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_data_created_time ON public.sys_dict_data USING btree (created_time);


--
-- Name: ix_sys_dict_data_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_data_id ON public.sys_dict_data USING btree (id);


--
-- Name: ix_sys_dict_data_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_data_status ON public.sys_dict_data USING btree (status);


--
-- Name: ix_sys_dict_data_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_data_updated_time ON public.sys_dict_data USING btree (updated_time);


--
-- Name: ix_sys_dict_data_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_dict_data_uuid ON public.sys_dict_data USING btree (uuid);


--
-- Name: ix_sys_dict_type_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_type_created_time ON public.sys_dict_type USING btree (created_time);


--
-- Name: ix_sys_dict_type_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_type_id ON public.sys_dict_type USING btree (id);


--
-- Name: ix_sys_dict_type_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_type_status ON public.sys_dict_type USING btree (status);


--
-- Name: ix_sys_dict_type_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_dict_type_updated_time ON public.sys_dict_type USING btree (updated_time);


--
-- Name: ix_sys_dict_type_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_dict_type_uuid ON public.sys_dict_type USING btree (uuid);


--
-- Name: ix_sys_log_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_log_created_id ON public.sys_log USING btree (created_id);


--
-- Name: ix_sys_log_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_log_created_time ON public.sys_log USING btree (created_time);


--
-- Name: ix_sys_log_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_log_id ON public.sys_log USING btree (id);


--
-- Name: ix_sys_log_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_log_status ON public.sys_log USING btree (status);


--
-- Name: ix_sys_log_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_log_updated_id ON public.sys_log USING btree (updated_id);


--
-- Name: ix_sys_log_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_log_updated_time ON public.sys_log USING btree (updated_time);


--
-- Name: ix_sys_log_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_log_uuid ON public.sys_log USING btree (uuid);


--
-- Name: ix_sys_menu_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_menu_created_time ON public.sys_menu USING btree (created_time);


--
-- Name: ix_sys_menu_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_menu_id ON public.sys_menu USING btree (id);


--
-- Name: ix_sys_menu_parent_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_menu_parent_id ON public.sys_menu USING btree (parent_id);


--
-- Name: ix_sys_menu_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_menu_status ON public.sys_menu USING btree (status);


--
-- Name: ix_sys_menu_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_menu_updated_time ON public.sys_menu USING btree (updated_time);


--
-- Name: ix_sys_menu_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_menu_uuid ON public.sys_menu USING btree (uuid);


--
-- Name: ix_sys_notice_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_notice_created_id ON public.sys_notice USING btree (created_id);


--
-- Name: ix_sys_notice_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_notice_created_time ON public.sys_notice USING btree (created_time);


--
-- Name: ix_sys_notice_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_notice_id ON public.sys_notice USING btree (id);


--
-- Name: ix_sys_notice_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_notice_status ON public.sys_notice USING btree (status);


--
-- Name: ix_sys_notice_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_notice_updated_id ON public.sys_notice USING btree (updated_id);


--
-- Name: ix_sys_notice_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_notice_updated_time ON public.sys_notice USING btree (updated_time);


--
-- Name: ix_sys_notice_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_notice_uuid ON public.sys_notice USING btree (uuid);


--
-- Name: ix_sys_param_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_param_created_time ON public.sys_param USING btree (created_time);


--
-- Name: ix_sys_param_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_param_id ON public.sys_param USING btree (id);


--
-- Name: ix_sys_param_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_param_status ON public.sys_param USING btree (status);


--
-- Name: ix_sys_param_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_param_updated_time ON public.sys_param USING btree (updated_time);


--
-- Name: ix_sys_param_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_param_uuid ON public.sys_param USING btree (uuid);


--
-- Name: ix_sys_position_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_position_created_id ON public.sys_position USING btree (created_id);


--
-- Name: ix_sys_position_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_position_created_time ON public.sys_position USING btree (created_time);


--
-- Name: ix_sys_position_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_position_id ON public.sys_position USING btree (id);


--
-- Name: ix_sys_position_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_position_status ON public.sys_position USING btree (status);


--
-- Name: ix_sys_position_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_position_updated_id ON public.sys_position USING btree (updated_id);


--
-- Name: ix_sys_position_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_position_updated_time ON public.sys_position USING btree (updated_time);


--
-- Name: ix_sys_position_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_position_uuid ON public.sys_position USING btree (uuid);


--
-- Name: ix_sys_role_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_role_created_time ON public.sys_role USING btree (created_time);


--
-- Name: ix_sys_role_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_role_id ON public.sys_role USING btree (id);


--
-- Name: ix_sys_role_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_role_status ON public.sys_role USING btree (status);


--
-- Name: ix_sys_role_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_role_updated_time ON public.sys_role USING btree (updated_time);


--
-- Name: ix_sys_role_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_role_uuid ON public.sys_role USING btree (uuid);


--
-- Name: ix_sys_tenant_api_key_api_key; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_tenant_api_key_api_key ON public.sys_tenant_api_key USING btree (api_key);


--
-- Name: ix_sys_tenant_api_key_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_key_created_time ON public.sys_tenant_api_key USING btree (created_time);


--
-- Name: ix_sys_tenant_api_key_expired_at; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_key_expired_at ON public.sys_tenant_api_key USING btree (expired_at);


--
-- Name: ix_sys_tenant_api_key_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_key_id ON public.sys_tenant_api_key USING btree (id);


--
-- Name: ix_sys_tenant_api_key_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_key_status ON public.sys_tenant_api_key USING btree (status);


--
-- Name: ix_sys_tenant_api_key_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_key_tenant_id ON public.sys_tenant_api_key USING btree (tenant_id);


--
-- Name: ix_sys_tenant_api_key_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_key_updated_time ON public.sys_tenant_api_key USING btree (updated_time);


--
-- Name: ix_sys_tenant_api_key_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_tenant_api_key_uuid ON public.sys_tenant_api_key USING btree (uuid);


--
-- Name: ix_sys_tenant_api_log_api_key_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_api_key_id ON public.sys_tenant_api_log USING btree (api_key_id);


--
-- Name: ix_sys_tenant_api_log_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_created_time ON public.sys_tenant_api_log USING btree (created_time);


--
-- Name: ix_sys_tenant_api_log_endpoint; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_endpoint ON public.sys_tenant_api_log USING btree (endpoint);


--
-- Name: ix_sys_tenant_api_log_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_id ON public.sys_tenant_api_log USING btree (id);


--
-- Name: ix_sys_tenant_api_log_request_ip; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_request_ip ON public.sys_tenant_api_log USING btree (request_ip);


--
-- Name: ix_sys_tenant_api_log_response_code; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_response_code ON public.sys_tenant_api_log USING btree (response_code);


--
-- Name: ix_sys_tenant_api_log_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_status ON public.sys_tenant_api_log USING btree (status);


--
-- Name: ix_sys_tenant_api_log_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_tenant_id ON public.sys_tenant_api_log USING btree (tenant_id);


--
-- Name: ix_sys_tenant_api_log_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_api_log_updated_time ON public.sys_tenant_api_log USING btree (updated_time);


--
-- Name: ix_sys_tenant_api_log_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_tenant_api_log_uuid ON public.sys_tenant_api_log USING btree (uuid);


--
-- Name: ix_sys_tenant_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_created_time ON public.sys_tenant USING btree (created_time);


--
-- Name: ix_sys_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_id ON public.sys_tenant USING btree (id);


--
-- Name: ix_sys_tenant_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_status ON public.sys_tenant USING btree (status);


--
-- Name: ix_sys_tenant_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_tenant_updated_time ON public.sys_tenant USING btree (updated_time);


--
-- Name: ix_sys_tenant_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_tenant_uuid ON public.sys_tenant USING btree (uuid);


--
-- Name: ix_sys_user_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_created_id ON public.sys_user USING btree (created_id);


--
-- Name: ix_sys_user_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_created_time ON public.sys_user USING btree (created_time);


--
-- Name: ix_sys_user_dept_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_dept_id ON public.sys_user USING btree (dept_id);


--
-- Name: ix_sys_user_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_id ON public.sys_user USING btree (id);


--
-- Name: ix_sys_user_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_status ON public.sys_user USING btree (status);


--
-- Name: ix_sys_user_tenant_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_tenant_id ON public.sys_user USING btree (tenant_id);


--
-- Name: ix_sys_user_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_updated_id ON public.sys_user USING btree (updated_id);


--
-- Name: ix_sys_user_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_sys_user_updated_time ON public.sys_user USING btree (updated_time);


--
-- Name: ix_sys_user_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_sys_user_uuid ON public.sys_user USING btree (uuid);


--
-- Name: ix_task_job_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_job_created_time ON public.task_job USING btree (created_time);


--
-- Name: ix_task_job_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_job_id ON public.task_job USING btree (id);


--
-- Name: ix_task_job_job_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_job_job_id ON public.task_job USING btree (job_id);


--
-- Name: ix_task_job_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_job_updated_time ON public.task_job USING btree (updated_time);


--
-- Name: ix_task_job_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_task_job_uuid ON public.task_job USING btree (uuid);


--
-- Name: ix_task_node_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_node_created_id ON public.task_node USING btree (created_id);


--
-- Name: ix_task_node_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_node_created_time ON public.task_node USING btree (created_time);


--
-- Name: ix_task_node_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_node_id ON public.task_node USING btree (id);


--
-- Name: ix_task_node_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_node_status ON public.task_node USING btree (status);


--
-- Name: ix_task_node_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_node_updated_id ON public.task_node USING btree (updated_id);


--
-- Name: ix_task_node_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_node_updated_time ON public.task_node USING btree (updated_time);


--
-- Name: ix_task_node_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_task_node_uuid ON public.task_node USING btree (uuid);


--
-- Name: ix_task_workflow_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_created_id ON public.task_workflow USING btree (created_id);


--
-- Name: ix_task_workflow_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_created_time ON public.task_workflow USING btree (created_time);


--
-- Name: ix_task_workflow_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_id ON public.task_workflow USING btree (id);


--
-- Name: ix_task_workflow_node_type_created_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_node_type_created_id ON public.task_workflow_node_type USING btree (created_id);


--
-- Name: ix_task_workflow_node_type_created_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_node_type_created_time ON public.task_workflow_node_type USING btree (created_time);


--
-- Name: ix_task_workflow_node_type_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_node_type_id ON public.task_workflow_node_type USING btree (id);


--
-- Name: ix_task_workflow_node_type_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_node_type_status ON public.task_workflow_node_type USING btree (status);


--
-- Name: ix_task_workflow_node_type_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_node_type_updated_id ON public.task_workflow_node_type USING btree (updated_id);


--
-- Name: ix_task_workflow_node_type_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_node_type_updated_time ON public.task_workflow_node_type USING btree (updated_time);


--
-- Name: ix_task_workflow_node_type_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_task_workflow_node_type_uuid ON public.task_workflow_node_type USING btree (uuid);


--
-- Name: ix_task_workflow_status; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_status ON public.task_workflow USING btree (status);


--
-- Name: ix_task_workflow_updated_id; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_updated_id ON public.task_workflow USING btree (updated_id);


--
-- Name: ix_task_workflow_updated_time; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX ix_task_workflow_updated_time ON public.task_workflow USING btree (updated_time);


--
-- Name: ix_task_workflow_uuid; Type: INDEX; Schema: public; Owner: admin
--

CREATE UNIQUE INDEX ix_task_workflow_uuid ON public.task_workflow USING btree (uuid);


--
-- Name: open_transfer_api_key_index; Type: INDEX; Schema: public; Owner: admin
--

CREATE INDEX open_transfer_api_key_index ON public.open_transfer USING btree (api_key);


--
-- Name: app_portal app_portal_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.app_portal
    ADD CONSTRAINT app_portal_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: app_portal app_portal_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.app_portal
    ADD CONSTRAINT app_portal_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: app_portal app_portal_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.app_portal
    ADD CONSTRAINT app_portal_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_demo01 gen_demo01_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_demo01
    ADD CONSTRAINT gen_demo01_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_demo01 gen_demo01_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_demo01
    ADD CONSTRAINT gen_demo01_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_demo gen_demo_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_demo
    ADD CONSTRAINT gen_demo_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_demo gen_demo_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_demo
    ADD CONSTRAINT gen_demo_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_table_column gen_table_column_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table_column
    ADD CONSTRAINT gen_table_column_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_table_column gen_table_column_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table_column
    ADD CONSTRAINT gen_table_column_table_id_fkey FOREIGN KEY (table_id) REFERENCES public.gen_table(id) ON DELETE CASCADE;


--
-- Name: gen_table_column gen_table_column_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table_column
    ADD CONSTRAINT gen_table_column_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_table gen_table_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table
    ADD CONSTRAINT gen_table_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: gen_table gen_table_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.gen_table
    ADD CONSTRAINT gen_table_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: open_conf open_conf_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.open_conf
    ADD CONSTRAINT open_conf_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: open_transfer open_transfer_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.open_transfer
    ADD CONSTRAINT open_transfer_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_account pay_account_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_account
    ADD CONSTRAINT pay_account_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_bill_order pay_bill_order_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_bill_order
    ADD CONSTRAINT pay_bill_order_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_bill pay_bill_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_bill
    ADD CONSTRAINT pay_bill_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_bill_voucher pay_bill_voucher_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_bill_voucher
    ADD CONSTRAINT pay_bill_voucher_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_department pay_department_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_department
    ADD CONSTRAINT pay_department_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_deposit pay_deposit_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_deposit
    ADD CONSTRAINT pay_deposit_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_employee pay_employee_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_employee
    ADD CONSTRAINT pay_employee_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_employee pay_employee_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_employee
    ADD CONSTRAINT pay_employee_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pay_enterprise pay_enterprise_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_enterprise
    ADD CONSTRAINT pay_enterprise_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_expense_institution pay_expense_institution_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_institution
    ADD CONSTRAINT pay_expense_institution_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_expense_issue_batch pay_expense_issue_batch_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_issue_batch
    ADD CONSTRAINT pay_expense_issue_batch_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_expense_quota_change_log pay_expense_quota_change_log_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_quota_change_log
    ADD CONSTRAINT pay_expense_quota_change_log_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_expense_quota pay_expense_quota_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_quota
    ADD CONSTRAINT pay_expense_quota_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_expense_rule pay_expense_rule_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_expense_rule
    ADD CONSTRAINT pay_expense_rule_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_facetoface_order pay_facetoface_order_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_facetoface_order
    ADD CONSTRAINT pay_facetoface_order_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_points_record pay_points_record_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_points_record
    ADD CONSTRAINT pay_points_record_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_points pay_points_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_points
    ADD CONSTRAINT pay_points_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_transfer pay_transfer_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_transfer
    ADD CONSTRAINT pay_transfer_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: pay_withdraw pay_withdraw_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.pay_withdraw
    ADD CONSTRAINT pay_withdraw_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: sys_dept sys_dept_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dept
    ADD CONSTRAINT sys_dept_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.sys_dept(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_dict_data sys_dict_data_dict_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_dict_data
    ADD CONSTRAINT sys_dict_data_dict_type_id_fkey FOREIGN KEY (dict_type_id) REFERENCES public.sys_dict_type(id) ON DELETE CASCADE;


--
-- Name: sys_log sys_log_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_log
    ADD CONSTRAINT sys_log_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_log sys_log_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_log
    ADD CONSTRAINT sys_log_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_menu sys_menu_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_menu
    ADD CONSTRAINT sys_menu_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.sys_menu(id) ON DELETE SET NULL;


--
-- Name: sys_notice sys_notice_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_notice
    ADD CONSTRAINT sys_notice_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_notice sys_notice_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_notice
    ADD CONSTRAINT sys_notice_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_position sys_position_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_position
    ADD CONSTRAINT sys_position_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_position sys_position_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_position
    ADD CONSTRAINT sys_position_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_role_depts sys_role_depts_dept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role_depts
    ADD CONSTRAINT sys_role_depts_dept_id_fkey FOREIGN KEY (dept_id) REFERENCES public.sys_dept(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_role_depts sys_role_depts_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role_depts
    ADD CONSTRAINT sys_role_depts_role_id_fkey FOREIGN KEY (role_id) REFERENCES public.sys_role(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_role_menus sys_role_menus_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role_menus
    ADD CONSTRAINT sys_role_menus_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.sys_menu(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_role_menus sys_role_menus_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_role_menus
    ADD CONSTRAINT sys_role_menus_role_id_fkey FOREIGN KEY (role_id) REFERENCES public.sys_role(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_tenant_api_key sys_tenant_api_key_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant_api_key
    ADD CONSTRAINT sys_tenant_api_key_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_tenant_api_log sys_tenant_api_log_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_tenant_api_log
    ADD CONSTRAINT sys_tenant_api_log_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: sys_user sys_user_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_user sys_user_dept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_dept_id_fkey FOREIGN KEY (dept_id) REFERENCES public.sys_dept(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: sys_user_positions sys_user_positions_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user_positions
    ADD CONSTRAINT sys_user_positions_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.sys_position(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_user_positions sys_user_positions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user_positions
    ADD CONSTRAINT sys_user_positions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_user_roles sys_user_roles_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user_roles
    ADD CONSTRAINT sys_user_roles_role_id_fkey FOREIGN KEY (role_id) REFERENCES public.sys_role(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_user_roles sys_user_roles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user_roles
    ADD CONSTRAINT sys_user_roles_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sys_user sys_user_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.sys_tenant(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: sys_user sys_user_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: task_node task_node_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_node
    ADD CONSTRAINT task_node_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: task_node task_node_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_node
    ADD CONSTRAINT task_node_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: task_workflow task_workflow_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow
    ADD CONSTRAINT task_workflow_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: task_workflow_node_type task_workflow_node_type_created_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow_node_type
    ADD CONSTRAINT task_workflow_node_type_created_id_fkey FOREIGN KEY (created_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: task_workflow_node_type task_workflow_node_type_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow_node_type
    ADD CONSTRAINT task_workflow_node_type_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: task_workflow task_workflow_updated_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: admin
--

ALTER TABLE ONLY public.task_workflow
    ADD CONSTRAINT task_workflow_updated_id_fkey FOREIGN KEY (updated_id) REFERENCES public.sys_user(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- PostgreSQL database dump complete
--

\unrestrict swEXqwojduBDQKpOx6Q25cRqHXnmaoe4Lr0hssIzgdaajrTqce9nudi6lVrIVLR

