diff --git a/migrations/20210325163147-addNewColumn.js b/migrations/20210325163147-addNewColumn.js new file mode 100644 index 0000000..befd9a5 --- /dev/null +++ b/migrations/20210325163147-addNewColumn.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')]); + }, +}; diff --git a/migrations/20210325170616-changeCodeMelliType.js b/migrations/20210325170616-changeCodeMelliType.js new file mode 100644 index 0000000..e774cbf --- /dev/null +++ b/migrations/20210325170616-changeCodeMelliType.js @@ -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')]); + }, +}; diff --git a/models/user.js b/models/user.js index 3dbb3f2..95e6324 100644 --- a/models/user.js +++ b/models/user.js @@ -17,7 +17,7 @@ module.exports = (sequelize, DataTypes) => { firstName: DataTypes.STRING, lastName: DataTypes.STRING, fatherName: DataTypes.STRING, - codeMelli: DataTypes.BIGINT, + codeMelli: DataTypes.STRING, workUnit: DataTypes.STRING, workUnitCode: DataTypes.INTEGER, address: DataTypes.TEXT, @@ -28,6 +28,8 @@ module.exports = (sequelize, DataTypes) => { writtenOrderNumber: DataTypes.INTEGER, writtenOrderDate: DataTypes.DATE, deadline: DataTypes.INTEGER, + healthCenter: DataTypes.STRING, + healthCenterCity: DataTypes.STRING, deadlineUnit: { type: DataTypes.STRING, defaultValue: 'روز'