-- 微信模板消息表
CREATE TABLE wechat_template (
                                                 id bigint IDENTITY(1,1) NOT NULL,
                                                 template_id varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 template_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 title varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 content1 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 content2 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 content3 varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
                                                 content4 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 content5 varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
                                                 remark varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
                                                 create_time datetime NULL,
                                                 update_time datetime NULL,
                                                 grade int NULL
);

-- Extended properties
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'微信模板ID', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'template_id';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'template_name';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容抬头', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'title';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容1', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'content1';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容2', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'content2';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容3', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'content3';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容4', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'content4';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容5', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'content5';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'remark';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'create_time';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'update_time';
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标志位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'wechat_template', @level2type=N'Column', @level2name=N'grade';

-- 项目，微信用户，模板关联表
create table wechat_template_project(
    id bigint IDENTITY(1,1) not null,
    project_id bigint,
    template_id bigint,
    wechat_user_id bigint,
    create_time datetime,
    update_time datetime,
    grade int
);

