Files
youlai-boot/sql/ttstd/sn_device_alarm.sql
T

33 lines
2.0 KiB
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.
-- =============================================================================
-- 设备闹钟表(sys_sn_alarm)
-- 说明:一设备多行,存放该设备的闹钟列表。家属端(/api/v1/client/sn/alarm)
-- 与设备端(/api/v1/sn/get_alarms|sync_alarms)共用;
-- 任意一端变更后推送 contentType=25,设备拉取整表覆盖本地 Room。
-- =============================================================================
CREATE TABLE IF NOT EXISTS `sys_sn_alarm`
(
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`serialno` VARCHAR(64) NOT NULL COMMENT '设备序列号(关联 sys_sn.serialno)',
`hour` INT NOT NULL DEFAULT 0 COMMENT '时',
`minute` INT NOT NULL DEFAULT 0 COMMENT '分',
`label` VARCHAR(100) DEFAULT NULL COMMENT '标签',
`repeat_type` INT NOT NULL DEFAULT 0 COMMENT '重复类型(0一次 1每天 2工作日 3自定义)',
`custom_days` VARCHAR(50) DEFAULT NULL COMMENT '自定义星期(2,3,6,7,Calendar.MONDAY=2)',
`is_enabled` TINYINT NOT NULL DEFAULT 1 COMMENT '开关(0关 1开)',
`vibration` TINYINT NOT NULL DEFAULT 0 COMMENT '振动(0否 1是)',
`volume` INT NOT NULL DEFAULT 80 COMMENT '音量(0-100)',
`ringtone_uri` VARCHAR(300) DEFAULT NULL COMMENT '铃声URI',
`snooze_interval` INT NOT NULL DEFAULT 5 COMMENT '贪睡间隔(分钟)',
-- ===================== 通用字段 =====================
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
`update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
`is_deleted` TINYINT DEFAULT 0 COMMENT '逻辑删除(0未删 1已删)',
PRIMARY KEY (`id`),
KEY `idx_serialno` (`serialno`),
KEY `idx_is_deleted` (`is_deleted`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COMMENT = '设备闹钟表';