Files
dafuweng-saiadmin6.x/server/db/dice_ante_config.sql
2026-03-25 14:33:58 +08:00

18 lines
936 B
SQL
Raw 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.
-- 底注配置表
CREATE TABLE IF NOT EXISTS `dice_ante_config` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`name` varchar(64) NOT NULL COMMENT '名称',
`title` varchar(255) NOT NULL COMMENT '标题',
`is_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否默认底注0否 1是全表只允许一条',
`mult` int NOT NULL DEFAULT 1 COMMENT '底注倍率',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_is_default` (`is_default`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Dice 底注配置表';
-- 可选初始化数据(保留一条默认底注)
INSERT INTO `dice_ante_config` (`name`, `title`, `is_default`, `mult`)
SELECT 'default', '默认底注', 1, 1
WHERE NOT EXISTS (SELECT 1 FROM `dice_ante_config` LIMIT 1);