物联网问题解决,只差最后测试完善
This commit is contained in:
10
tradeCattle/add_tenant_id_field.sql
Normal file
10
tradeCattle/add_tenant_id_field.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- 在iot_device_data表中添加tenant_id字段,关联到sys_tenant表的主键
|
||||
-- 用于实现租户设备分配功能
|
||||
|
||||
ALTER TABLE `iot_device_data`
|
||||
ADD COLUMN `tenant_id` int(11) DEFAULT NULL COMMENT '租户ID,关联sys_tenant表主键';
|
||||
|
||||
-- 添加外键约束(可选)
|
||||
-- ALTER TABLE `iot_device_data`
|
||||
-- ADD CONSTRAINT `fk_iot_device_tenant`
|
||||
-- FOREIGN KEY (`tenant_id`) REFERENCES `sys_tenant`(`id`) ON DELETE SET NULL;
|
||||
Reference in New Issue
Block a user