Guest User

Untitled

a guest
Mar 22nd, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. module.exports = (sequelize, DataTypes) => {
  2. const indicationsIndicated = sequelize.define(
  3. "indicationsIndicated",
  4. {
  5. name: {
  6. type: DataTypes.STRING(50),
  7. allowNull: false
  8. },
  9. email: {
  10. type: DataTypes.STRING(50),
  11. allowNull: true
  12. },
  13. phone: {
  14. type: DataTypes.STRING(50),
  15. allowNull: false,
  16. unique: true
  17. },
  18. status: {
  19. type: DataTypes.INTEGER,
  20. allowNull: false,
  21. defaultValue: 1,
  22. validate: {
  23. isIn: [[1, 2, 3, 4]]
  24. }
  25. }
  26. },
  27. {}
  28. );
  29. indicationsIndicated.associate = function(models) {
  30. indicationsIndicated.belongsTo(models.indicationsUser, {
  31. foreignKey: {
  32. allowNull: false
  33. }
  34. });
  35. indicationsIndicated.belongsTo(models.company, {
  36. foreignKey: {
  37. allowNull: false
  38. }
  39. });
  40. };
  41. return indicationsIndicated;
  42. };
Add Comment
Please, Sign In to add comment