Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = (sequelize, DataTypes) => {
- const indicationsIndicated = sequelize.define(
- "indicationsIndicated",
- {
- name: {
- type: DataTypes.STRING(50),
- allowNull: false
- },
- email: {
- type: DataTypes.STRING(50),
- allowNull: true
- },
- phone: {
- type: DataTypes.STRING(50),
- allowNull: false,
- unique: true
- },
- status: {
- type: DataTypes.INTEGER,
- allowNull: false,
- defaultValue: 1,
- validate: {
- isIn: [[1, 2, 3, 4]]
- }
- }
- },
- {}
- );
- indicationsIndicated.associate = function(models) {
- indicationsIndicated.belongsTo(models.indicationsUser, {
- foreignKey: {
- allowNull: false
- }
- });
- indicationsIndicated.belongsTo(models.company, {
- foreignKey: {
- allowNull: false
- }
- });
- };
- return indicationsIndicated;
- };
Add Comment
Please, Sign In to add comment