synt_backend
Version:
Synt light-weight node backend service
30 lines (29 loc) • 710 B
JavaScript
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class LotPhase extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
this.belongsTo(models.Lot);
this.belongsToMany(models.User, {
through: { model: "LotPhaseUser" },
});
}
}
LotPhase.init(
{
starts_at: DataTypes.DATEONLY,
ends_at: DataTypes.DATEONLY,
},
{
sequelize,
modelName: "LotPhase",
}
);
return LotPhase;
};
;