%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/workflow/src/models/
Upload File :
Create Path :
Current File : /home/opti/workflow/src/models/flow.js

'use strict';
module.exports = (sequelize, DataTypes) => {
  const Flow = sequelize.define('Flow', {
    uuid: {
      type: DataTypes.UUID,
      defaultValue: DataTypes.UUIDV4
    },
    companyStructureId: DataTypes.INTEGER,
    orgId: DataTypes.INTEGER,
    title: DataTypes.STRING,
    description: DataTypes.STRING,
    createdBy: DataTypes.INTEGER,
    updatedBy: DataTypes.INTEGER,
    active: {
      type: DataTypes.INTEGER,
      defaultValue: 0
    },
    
  }, {});
  Flow.associate = function(models) {
    // associations can be defined here
    Flow.belongsTo(models.CompanyStructure, {foreignKey: 'companyStructureId', as: 'structure'});
    Flow.belongsTo(models.Organization, {foreignKey: 'orgId', as: 'organisation'});
    Flow.hasMany(models.FlowTitle, {foreignKey: 'flowId', as: 'flowTitles'});
  };
  return Flow;
};

Zerion Mini Shell 1.0