UNPKG

synt_backend

Version:

Synt light-weight node backend service

31 lines (30 loc) 787 B
"use strict"; const { Model } = require("sequelize"); module.exports = (sequelize, DataTypes) => { class DistributionKey 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 DistributionKey.belongsToMany(models.Lot, { through: "DistributionKeyLot", }); DistributionKey.belongsTo(models.VME); } } DistributionKey.init( { name: DataTypes.STRING, description: DataTypes.STRING, type: DataTypes.ENUM("S", "U"), }, { sequelize, modelName: "DistributionKey", } ); return DistributionKey; };