origin_batch.py 1.0 KB

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:origin_batch.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class Origin_batch(Model):
  10. __table__ = 'origin_batch'
  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(150)', comment='产品名')
  15. zzdate = Fields(type='int', comment='种植时间')
  16. csdate = Fields(type='int', comment='采收时间')
  17. land_id = Fields(type='uuid', comment='地块id')
  18. gateway_id = Fields(type='uuid', comment='网关id')
  19. number = Fields(type='varchar(32)', comment='批号')
  20. pic = Fields(type='text', comment='图像记录')
  21. state = Fields(type='boolean', default='True', comment='数据存在状态')
  22. cdate = Fields(type='int', default='time', comment='创建时间')
  23. pic_id = Fields(type='uuid', comment='摄像头设备id')
  24. #ALTER TABLE demeter_origin_batch ADD pic_id uuid;