Commit b2dbdd66 by mercymodest

feat:- add sql

parent 96e9bf44
alter table t_events alter table t_events
...@@ -7,3 +7,36 @@ alter table t_events ...@@ -7,3 +7,36 @@ alter table t_events
create index t_event_category_relations_event_id_index create index t_event_category_relations_event_id_index
on t_event_category_relations (event_id); on t_event_category_relations (event_id);
-- 创建杂物完成记录表
CREATE TABLE t_misc_event_records (
-- 主键 ID,使用自增
misc_event_record_id BIGINT NOT NULL,
-- 设备 ID
device_id BIGINT NOT NULL COMMENT '设备ID',
-- 事件 ID
origin_event_id BIGINT NOT NULL COMMENT '事件ID',
start_datetime datetime null comment '事项开始时间(UTC+0)',
start_date date null comment '开始日期',
start_time time null comment '开始时间',
end_datetime datetime null comment '事项结束时间(UTC+0)',
end_date date null comment '结束日期',
end_time time null comment '结束时间',
completed_time DATETIME NOT NULL COMMENT '杂物完成时间',
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间,插入时自动更新',
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间,插入和更新时自动更新',
-- 主键约束
PRIMARY KEY (misc_event_record_id),
-- 索引
INDEX idx_device_id (device_id),
INDEX idx_origin_event_id (origin_event_id),
INDEX idc_start_datetime (start_datetime)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='杂物完成记录表';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment