-- public.tb_customer_follow_template definition

-- Drop table

-- DROP TABLE public.tb_customer_follow_template;

CREATE TABLE public.tb_customer_follow_template (
                                                    id varchar(32) NOT NULL, -- 主键id
                                                    "name" varchar(64) NOT NULL, -- 模板名称
                                                    remark text NULL, -- 备注
                                                    sys_org_code varchar(16) NULL, -- 所属机构
                                                    create_time timestamp NULL, -- 创建时间
                                                    update_time timestamp NULL, -- 更新时间
                                                    create_by varchar(32) NULL, -- 创建人
                                                    update_by varchar(32) NULL, -- 更新人
                                                    CONSTRAINT tb_customer_follow_template_pk PRIMARY KEY (id)
);
COMMENT ON TABLE public.tb_customer_follow_template IS '客户回访模板';

-- Column comments

COMMENT ON COLUMN public.tb_customer_follow_template.id IS '主键id';
COMMENT ON COLUMN public.tb_customer_follow_template."name" IS '模板名称';
COMMENT ON COLUMN public.tb_customer_follow_template.remark IS '备注';
COMMENT ON COLUMN public.tb_customer_follow_template.sys_org_code IS '所属机构';
COMMENT ON COLUMN public.tb_customer_follow_template.create_time IS '创建时间';
COMMENT ON COLUMN public.tb_customer_follow_template.update_time IS '更新时间';
COMMENT ON COLUMN public.tb_customer_follow_template.create_by IS '创建人';
COMMENT ON COLUMN public.tb_customer_follow_template.update_by IS '更新人';


-- public.tb_customer_follow_template_part definition

-- Drop table

-- DROP TABLE public.tb_customer_follow_template_part;

CREATE TABLE public.tb_customer_follow_template_part (
                                                         id varchar(32) NOT NULL, -- 主键id
                                                         category_name varchar(64) NULL, -- 回访类别
                                                         follow_name varchar(64) NULL, -- 回访题目
                                                         sort int2 NOT NULL DEFAULT 1, -- 排序
                                                         template_id varchar(32) NULL, -- 模板id
                                                         sys_org_code varchar(16) NULL, -- 所属机构
                                                         create_time timestamp NULL, -- 创建时间
                                                         update_time timestamp NULL, -- 更新时间
                                                         create_by varchar(32) NULL, -- 创建人
                                                         update_by varchar(32) NULL, -- 更新人
                                                         CONSTRAINT tb_customer_follow_template_part_pk PRIMARY KEY (id)
);
COMMENT ON TABLE public.tb_customer_follow_template_part IS '客户回放模板详情';

-- Column comments

COMMENT ON COLUMN public.tb_customer_follow_template_part.id IS '主键id';
COMMENT ON COLUMN public.tb_customer_follow_template_part.category_name IS '回访类别';
COMMENT ON COLUMN public.tb_customer_follow_template_part.follow_name IS '回访题目';
COMMENT ON COLUMN public.tb_customer_follow_template_part.sort IS '排序';
COMMENT ON COLUMN public.tb_customer_follow_template_part.template_id IS '模板id';
COMMENT ON COLUMN public.tb_customer_follow_template_part.sys_org_code IS '所属机构';
COMMENT ON COLUMN public.tb_customer_follow_template_part.create_time IS '创建时间';
COMMENT ON COLUMN public.tb_customer_follow_template_part.update_time IS '更新时间';
COMMENT ON COLUMN public.tb_customer_follow_template_part.create_by IS '创建人';
COMMENT ON COLUMN public.tb_customer_follow_template_part.update_by IS '更新人';