-- ----------------------------
-- 增加资源编号字段
-- ----------------------------
ALTER TABLE "BLADEX"."BLADE_OSS"
    ADD ("OSS_CODE" VARCHAR2(32) );

COMMENT ON COLUMN "BLADEX"."BLADE_OSS"."OSS_CODE" IS '资源编号'

-- ----------------------------
-- 增加短信配置表
-- ----------------------------
CREATE TABLE "BLADEX"."BLADE_SMS" (
"ID" NUMBER(20) NOT NULL ,
"TENANT_ID" NVARCHAR2(12) ,
"CATEGORY" NUMBER(11) ,
"SMS_CODE" VARCHAR2(12) ,
"TEMPLATE_ID" VARCHAR2(64) ,
"ACCESS_KEY" NVARCHAR2(255) ,
"SECRET_KEY" NVARCHAR2(255) ,
"REGION_ID" NVARCHAR2(255) ,
"SIGN_NAME" VARCHAR2(64) ,
"REMARK" NVARCHAR2(255) ,
"CREATE_USER" NUMBER(20) ,
"CREATE_DEPT" NUMBER(20) ,
"CREATE_TIME" DATE ,
"UPDATE_USER" NUMBER(20) ,
"UPDATE_TIME" DATE ,
"STATUS" NUMBER(11) ,
"IS_DELETED" NUMBER(11) ,
PRIMARY KEY ("ID")
)
;
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."ID" IS '主键';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."TENANT_ID" IS '租户ID';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CATEGORY" IS '分类';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."SMS_CODE" IS '资源编号';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."TEMPLATE_ID" IS '模板ID';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."ACCESS_KEY" IS 'accessKey';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."SECRET_KEY" IS 'secretKey';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."REGION_ID" IS 'regionId';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."SIGN_NAME" IS '短信签名';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."REMARK" IS '备注';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CREATE_DEPT" IS '创建部门';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."UPDATE_USER" IS '修改人';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."UPDATE_TIME" IS '修改时间';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."STATUS" IS '状态';
COMMENT ON COLUMN "BLADEX"."BLADE_SMS"."IS_DELETED" IS '是否已删除';
COMMENT ON TABLE "BLADEX"."BLADE_SMS" IS '短信配置表';

-- ----------------------------
-- 增加短信配置菜单数据
-- ----------------------------
INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
VALUES ('1164733389658962251', '1123598815738675298', 'sms', '短信配置', 'menu', '/resource/sms', 'iconfont iconicon_message', 2, 1, 0, 1, NULL, 0);
INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
VALUES ('1164733389658962252', '1164733389658962251', 'sms_add', '新增', 'add', '/resource/sms/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
VALUES ('1164733389658962253', '1164733389658962251', 'sms_edit', '修改', 'edit', '/resource/sms/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
VALUES ('1164733389658962254', '1164733389658962251', 'sms_delete', '删除', 'delete', '/api/blade-resource/sms/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
VALUES ('1164733389658962255', '1164733389658962251', 'sms_view', '查看', 'view', '/resource/sms/view', 'file-text', 4, 2, 2, 1, NULL, 0);
INSERT INTO "BLADEX"."BLADE_MENU"("ID", "PARENT_ID", "CODE", "NAME", "ALIAS", "PATH", "SOURCE", "SORT", "CATEGORY", "ACTION", "IS_OPEN", "REMARK", "IS_DELETED")
VALUES ('1164733389658962256', '1164733389658962251', 'sms_enable', '启用', 'enable', '/api/blade-resource/sms/enable', 'key', 5, 2, 2, 2, NULL, 0);

-- ----------------------------
-- 增加短信配置菜单权限数据
-- ----------------------------
INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
VALUES ('1161272893873222991', '1164733389658962251', '1123598816738675201');
INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
VALUES ('1161272893873222992', '1164733389658962252', '1123598816738675201');
INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
VALUES ('1161272893873222993', '1164733389658962253', '1123598816738675201');
INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
VALUES ('1161272893873222994', '1164733389658962254', '1123598816738675201');
INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
VALUES ('1161272893873222995', '1164733389658962255', '1123598816738675201');
INSERT INTO "BLADEX"."BLADE_ROLE_MENU"(ID,MENU_ID,ROLE_ID)
VALUES ('1161272893873222996', '1164733389658962256', '1123598816738675201');

-- ----------------------------
-- 增加短信配置字典数据
-- ----------------------------
INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
VALUES (1123598814738677220, 0, 'sms', '-1', '短信服务类型', 11, NULL, 0, 0);
INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
VALUES (1123598814738677221, 1123598814738677220, 'sms', '1', 'yunpian', 1, NULL, 0, 0);
INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
VALUES (1123598814738677222, 1123598814738677220, 'sms', '2', 'qiniu', 2, NULL, 0, 0);
INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
VALUES (1123598814738677223, 1123598814738677220, 'sms', '3', 'ali', 3, NULL, 0, 0);
INSERT INTO "BLADEX"."BLADE_DICT"("ID", "PARENT_ID", "CODE", "DICT_KEY", "DICT_VALUE", "SORT", "REMARK", "IS_SEALED", "IS_DELETED")
VALUES (1123598814738677224, 1123598814738677220, 'sms', '4', 'tencent', 4, NULL, 0, 0);
