%PDF- %PDF-
Direktori : /home/opti/workflow/src/migrations/ |
Current File : /home/opti/workflow/src/migrations/20190220095713-create-business-structure.js |
'use strict'; var OrganisationStructure = require('../models/organisationstructure'); var User = require('../models/user'); module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.createTable('BusinessStructures', { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER }, orgId: { type: Sequelize.INTEGER }, email :{ allowNull: false, type: Sequelize.STRING }, name: { type: Sequelize.STRING }, orgStructureId: { type: Sequelize.INTEGER, // foreignKey: true, // references: { // model: OrganisationStructure, // key: 'id' // } }, createdAt: { allowNull: false, type: Sequelize.DATE }, updatedAt: { allowNull: false, type: Sequelize.DATE }, email :{ allowNull: false, type: Sequelize.STRING }, head: { type: Sequelize.INTEGER, // foreignKey: true, // references: { // model: User, // key: 'id' // } }, assistant: { type: Sequelize.INTEGER, // foreignKey: true, // references: { // model: User, // key: 'id' // } } }); }, down: (queryInterface, Sequelize) => { return queryInterface.dropTable('BusinessStructures'); } };