master
shoaibalmasi 4 years ago
parent 2345d0699d
commit 9a7853dc82
  1. 21
      migrations/20210325163147-addNewColumn.js
  2. 15
      migrations/20210325170616-changeCodeMelliType.js
  3. 4
      models/user.js

@ -0,0 +1,21 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.addColumn('Users', 'healthCenter', {
type: Sequelize.STRING,
allowNull: true,
}),
queryInterface.addColumn('Users', 'healthCenterCity', {
type: Sequelize.STRING,
allowNull: true,
}),
]);
},
down: (queryInterface) => {
return Promise.all([queryInterface.removeColumn('Users', 'healthCenter'),
queryInterface.removeColumn('Users', 'healthCenterCity')]);
},
};

@ -0,0 +1,15 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.changeColumn('Users', 'codeMelli', {
type: Sequelize.STRING,
}),
]);
},
down: (queryInterface) => {
return Promise.all([queryInterface.changeColumn('Users', 'codeMelli')]);
},
};

@ -17,7 +17,7 @@ module.exports = (sequelize, DataTypes) => {
firstName: DataTypes.STRING, firstName: DataTypes.STRING,
lastName: DataTypes.STRING, lastName: DataTypes.STRING,
fatherName: DataTypes.STRING, fatherName: DataTypes.STRING,
codeMelli: DataTypes.BIGINT, codeMelli: DataTypes.STRING,
workUnit: DataTypes.STRING, workUnit: DataTypes.STRING,
workUnitCode: DataTypes.INTEGER, workUnitCode: DataTypes.INTEGER,
address: DataTypes.TEXT, address: DataTypes.TEXT,
@ -28,6 +28,8 @@ module.exports = (sequelize, DataTypes) => {
writtenOrderNumber: DataTypes.INTEGER, writtenOrderNumber: DataTypes.INTEGER,
writtenOrderDate: DataTypes.DATE, writtenOrderDate: DataTypes.DATE,
deadline: DataTypes.INTEGER, deadline: DataTypes.INTEGER,
healthCenter: DataTypes.STRING,
healthCenterCity: DataTypes.STRING,
deadlineUnit: { deadlineUnit: {
type: DataTypes.STRING, type: DataTypes.STRING,
defaultValue: 'روز' defaultValue: 'روز'

Loading…
Cancel
Save