Commit a857c081 by mercymodest

feat:- add sql

parent 36eeab56
-- 设备表 t_device 新增字段:
-- 设备表 t_device 新增字段:
-- 设备表 t_device 新增字段:
-- 设备序列号
-- 设备类型 0:相框 1:AI闹钟 default 0
ALTER TABLE
`t_device`
ADD
COLUMN `device_type` TINYINT NOT NULL DEFAULT 0 COMMENT '设备类型 0:相框 1:AI闹钟 default 0';
# ALTER TABLE
# `t_device`
# ADD
# COLUMN `device_type` TINYINT NOT NULL DEFAULT 0 COMMENT '设备类型 0:相框 1:AI闹钟 default 0';
-- 设备码表 t_user_device_codes 新增字段:
-- 设备类型 0:相框 1:AI闹钟 default 0
ALTER TABLE
`t_user_device_codes`
ADD
COLUMN `device_type` TINYINT NOT NULL DEFAULT 0 COMMENT '设备类型 0:相框 1:AI闹钟 default 0';
# ALTER TABLE
# `t_user_device_codes`
# ADD
# COLUMN `device_type` TINYINT NOT NULL DEFAULT 0 COMMENT '设备类型 0:相框 1:AI闹钟 default 0';
-- 用户ID 设置为非必填(AI闹钟扫描分享无法确定用户)
alter table t_user_device_share_code
modify user_id bigint null comment '用户 ID 设置为非必填(AI闹钟扫描分享无法确定用户)';
-- 设备码长度变长
alter table t_user_device_share_code
modify share_code varchar(220) null comment '分享码';
-- 创建唯一索引
create unique index idx_share_code
on t_user_device_share_code (share_code)
comment '分享码';
# -- 创建唯一索引
# create unique index idx_share_code
# on t_user_device_share_code (share_code)
# comment '分享码';
-- 设备类型 0:相框 1:AI闹钟 default 0
alter table t_user_device_share_code
add device_type tinyint default 0 null comment '设备类型 0:相框 1:AI闹钟 default 0' after device_id;
# alter table t_user_device_share_code
# add device_type tinyint default 0 null comment '设备类型 0:相框 1:AI闹钟 default 0' after device_id;
-- 完善字段注释说明
alter table t_user_device_share_code
modify valid_time datetime null comment '分享码有效时间,为空则表示长期有效.(扫描分享:设备未绑定二维码长期有效)';
-- 新增设备名称字段
alter table t_user_device_codes
add device_name varchar(200) null comment '用户创建设备输入的设备名称' after device_id;
# alter table t_user_device_codes
# add device_name varchar(200) null comment '用户创建设备输入的设备名称' after device_id;
-- 移动设备类型字段位置
alter table t_user_device_codes
modify device_type tinyint default 0 not null comment '设备类型 0:相框 1:AI闹钟 default 0' after device_name;
# alter table t_user_device_codes
# modify device_type tinyint default 0 not null comment '设备类型 0:相框 1:AI闹钟 default 0' after device_name;
-- 完善字段注释说明
alter table t_user_device_share_code
......@@ -64,14 +57,14 @@ alter table t_im_push_app
alter table t_user_device
add device_type tinyint default 0 null comment '设备类型 0:相框 1:AI闹钟 default 0';
# alter table t_user_device
# add device_type tinyint default 0 null comment '设备类型 0:相框 1:AI闹钟 default 0';
alter table t_user_device_codes
add system_device_serial_number varchar(200) null comment '设备序列号(系统唯一,序列号激活设备流程) t_device_serial_number.device_serial_number' after device_type;
alter table t_user_device_share_code
add system_device_serial_number varchar(200) null comment '设备序列号' after valid_time;
# alter table t_user_device_codes
# add system_device_serial_number varchar(200) null comment '设备序列号(系统唯一,序列号激活设备流程) t_device_serial_number.device_serial_number' after device_type;
#
# alter table t_user_device_share_code
# add system_device_serial_number varchar(200) null comment '设备序列号' after valid_time;
alter table t_user_device_share_code
modify device_id bigint null comment '设备 ID (设备数据跟随的是虚拟设备) t_user_device_codes#deviceId';
......@@ -79,19 +72,19 @@ alter table t_user_device_share_code
alter table t_im_push
modify device_id bigint null comment '设备ID';
alter table t_im_push
add system_device_serial_number varchar(200) null comment '设备序列号(系统唯一,序列号激活设备流程)' after message_type;
# alter table t_im_push
# add system_device_serial_number varchar(200) null comment '设备序列号(系统唯一,序列号激活设备流程)' after message_type;
alter table t_im_push_app
modify device_id bigint null comment '设备ID';
alter table t_im_push_app
add system_device_serial_number varchar(200) null comment '设备序列号(系统唯一,序列号激活设备流程)' after message_type;
alter table t_events
modify event_type tinyint(1) not null comment '事项类型:0 表示事项,1 表示晚餐计划,2 表示任务(原杂物) 3 餐食计划。';
# alter table t_im_push_app
# add system_device_serial_number varchar(200) null comment '设备序列号(系统唯一,序列号激活设备流程)' after message_type;
alter table t_user
add user_time_format tinyint null comment '用户时间格式制式 0:无意义,保证枚举的正常解析 12:12小时制式 24:24小时制式';
# alter table t_events
# modify event_type tinyint(1) not null comment '事项类型:0 表示事项,1 表示晚餐计划,2 表示任务(原杂物) 3 餐食计划。';
#
# alter table t_user
# add user_time_format tinyint null comment '用户时间格式制式 0:无意义,保证枚举的正常解析 12:12小时制式 24:24小时制式';
# TODO 当前索引需要升级为唯一索引
-- 用户ID 设置为非必填(AI闹钟扫描分享无法确定用户)
# TODO 当前索引需要升级为唯一索引
# create index idx_share_code
# on t_user_device_share_code (share_code);
-- 用户ID 设置为非必填(AI闹钟扫描分享无法确定用户)
alter table t_user_device_share_code
modify user_id bigint null comment '用户 ID 设置为非必填(AI闹钟扫描分享无法确定用户)';
# AI 闹钟用户输入的设备名称支持 300个字符
alter table t_user_device_codes
modify device_name varchar(400) null comment '用户创建设备输入的设备名称';
alter table t_device
modify device_name varchar(400) null comment '设备名称';
alter table t_device
modify device_code varchar(400) null comment '设备编号';
# 系统序列号创建唯一索引
alter table t_user_device_codes
add constraint unique_system_device_serial_number
......
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