Files
RuoYi-Vue/sql/copy_template_scene.sql
2026-09-14 17:40:52 +08:00

32 lines
1.0 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 文案模板增加使用场景,并初始化“复制发货链接”模板(已有数据库升级脚本)
ALTER TABLE `tt_copy_template`
ADD COLUMN `template_scene` VARCHAR(20) NOT NULL DEFAULT 'CODE'
COMMENT '模板场景(CODE源码文案 DELIVERY发货文案)' AFTER `template_group`;
-- 历史模板均为源码文案
UPDATE `tt_copy_template`
SET `template_scene` = 'CODE'
WHERE `template_scene` IS NULL OR TRIM(`template_scene`) = '';
-- 将原先写死在项目清单前端的发货文案迁入模板表
INSERT INTO `tt_copy_template`
(`template_name`, `template_group`, `template_scene`, `template_body`, `sort_num`, `status`, `create_time`, `create_by`)
SELECT
'复制发货链接',
'发货文案',
'DELIVERY',
'{deliveryLinks}
项目部署文档
https://www.yuque.com/feastcoding/cg5w9h/rbvp8w80h8tultgy 密码:el4q',
1,
'0',
NOW(),
'admin'
WHERE NOT EXISTS (
SELECT 1
FROM `tt_copy_template`
WHERE `template_scene` = 'DELIVERY'
AND `template_name` = '复制发货链接'
);