Files
lgp-admin-plus-api/database/sql/2026-08-17/02_cc_wx_card_scheme.sql

30 lines
1.4 KiB
MySQL
Raw Normal View History

2026-08-19 08:16:49 +08:00
-- ============================================================
-- 卡片画布方案表15 套预设由后台 init-presets 灌 layers JSON
-- ============================================================
SET @db := DATABASE();
SET @exists := (
SELECT COUNT(*) FROM information_schema.TABLES
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'cc_wx_card_scheme'
);
SET @sql := IF(@exists = 0,
'CREATE TABLE `cc_wx_card_scheme` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '''' COMMENT '''',
`code` varchar(50) NOT NULL DEFAULT '''' COMMENT '''',
`preview` varchar(500) NOT NULL DEFAULT '''' COMMENT '''',
`layers` mediumtext COMMENT '' JSON'',
`is_preset` tinyint NOT NULL DEFAULT 0 COMMENT ''1='',
`app_code` varchar(20) NOT NULL DEFAULT '''' COMMENT ''='',
`sort` int NOT NULL DEFAULT 0,
`status` tinyint NOT NULL DEFAULT 0 COMMENT ''0= 1='',
`created_at` int NOT NULL DEFAULT 0,
`updated_at` int NOT NULL DEFAULT 0,
`deleted_at` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_wx_card_scheme_code` (`code`, `app_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=''''',
'SELECT ''skip cc_wx_card_scheme'' AS msg'
);
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;