文件还在测试中
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- 006 页面编辑模式:为 pages 表增加 mode 字段
|
||||
-- 用途:后台「页面」编辑支持「固定版面 fixed / 可视化编辑 builder」两种模式
|
||||
-- 幂等:用 information_schema 判断列是否存在,存在则跳过(兼容 MySQL 5.7 / 8.x 全版本及 MariaDB)
|
||||
-- 旧数据默认 'fixed',渲染行为不变;已用可视化编辑器存过 layout 的页面可手动置为 'builder'
|
||||
-- 应用方式:后台「系统 / 数据库升级」→ 找到本文件 → 点「升级」
|
||||
|
||||
SET @db = DATABASE();
|
||||
SET @has = (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'pages' AND COLUMN_NAME = 'mode');
|
||||
SET @sql = IF(@has = 0, 'ALTER TABLE `pages` ADD COLUMN `mode` VARCHAR(16) NOT NULL DEFAULT \'fixed\' AFTER `layout`', 'SELECT 1');
|
||||
PREPARE stmt FROM @sql;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
Reference in New Issue
Block a user