device_gateway.py 1.1 KB

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:device_gateway.py
  6. author:rabin
  7. """
  8. from .__load__ import *
  9. class Device_gateway(Model):
  10. __table__ = 'device_gateway'
  11. __comment__ = '设备网关管理'
  12. id = Fields(type='uuid', primaryKey=True, comment='网关ID', uuid='farm_id')
  13. farm_id = Fields(type='int', default='setting.farm', comment='园区ID', match='not')
  14. name = Fields(type='varchar(50)', comment='网关名')
  15. hardware_id = Fields(type='bigint', comment='硬件id', match='number|硬件id必须是数字')
  16. pic = Fields(type='varchar(255)', comment='设备分布图纸')
  17. camera = Fields(type='varchar(500)', comment='摄像头实时流地址')
  18. stat = Fields(type='boolean', default='False', comment='是否显示趋势图')
  19. state = Fields(type='boolean', default='True', comment='数据存在状态')
  20. cdate = Fields(type='int', default='time', comment='创建时间')
  21. product_id = Fields(type='int', comment='产品id')
  22. server_id = Fields(type='int', comment='服务id')
  23. #ALTER TABLE demeter_device_gateway ADD product_id int;
  24. #ALTER TABLE demeter_device_gateway ADD server_id int;