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

const { DataTypes } = require("sequelize");
const seq = require("../db/seq");
const Coop = seq.define("chicken_coop", {
// id 会被sequelize自动创建, 管理
coop_name: {
type: DataTypes.STRING,
allowNull: false,
comment: "鸡舍名称",
},
coop_cage_number: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "鸡舍笼位",
},
chicken_number: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "每笼鸡位",
},
house_id: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "所属鸡场id, 相当于外键",
},
is_empty: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: 1,
comment: "是否为空舍,1为空,0为非空",
},
});
// 强制同步数据库(创建数据表)
// Coop.sync({ force: true });
module.exports = Coop;