石墨消解仪后端用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.

38 lines
843 B

2 years ago
2 years ago
2 years ago
  1. const { DataTypes } = require("sequelize");
  2. const seq = require("../db/seq");
  3. const Coop = seq.define("chicken_coop", {
  4. // id 会被sequelize自动创建, 管理
  5. coop_name: {
  6. type: DataTypes.STRING,
  7. allowNull: false,
  8. comment: "鸡舍名称",
  9. },
  10. coop_cage_number: {
  11. type: DataTypes.INTEGER,
  12. allowNull: false,
  13. comment: "鸡舍笼位",
  14. },
  15. chicken_number: {
  16. type: DataTypes.INTEGER,
  17. allowNull: false,
  18. comment: "每笼鸡位",
  19. },
  20. house_id: {
  21. type: DataTypes.INTEGER,
  22. allowNull: false,
  23. comment: "所属鸡场id, 相当于外键",
  24. },
  25. is_empty: {
  26. type: DataTypes.BOOLEAN,
  27. allowNull: false,
  28. defaultValue: 1,
  29. comment: "是否为空舍,1为空,0为非空",
  30. },
  31. });
  32. // 强制同步数据库(创建数据表)
  33. // Coop.sync({ force: true });
  34. module.exports = Coop;