石墨消解仪后端用nodejs编写,与嵌入式端交互和前端交互均用ws
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
768 B

2 years ago
  1. const { DataTypes } = require("sequelize");
  2. const seq = require("../db/seq");
  3. // 鸡苗品种
  4. const Device = seq.define("chicken_device", {
  5. // id 会被sequelize自动创建, 管理
  6. egg_gathering: {
  7. type: DataTypes.BOOLEAN,
  8. allowNull: false,
  9. defaultValue: 0,
  10. comment: "急蛋设备开关",
  11. },
  12. illumination: {
  13. type: DataTypes.BOOLEAN,
  14. allowNull: false,
  15. defaultValue: 0,
  16. comment: "光照开关",
  17. },
  18. air_conditioner: {
  19. type: DataTypes.BOOLEAN,
  20. allowNull: false,
  21. defaultValue: 0,
  22. comment: "空调开关",
  23. },
  24. coop_id: {
  25. type: DataTypes.INTEGER,
  26. allowNull: false,
  27. comment: "鸡舍id",
  28. },
  29. });
  30. // 强制同步数据库(创建数据表)
  31. // Device.sync({ force: true });
  32. module.exports = Device;