@itleanchatbot/shared-models-js-postgres 2.7.3 → 2.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itleanchatbot/shared-models-js-postgres",
3
- "version": "2.7.3",
3
+ "version": "2.7.5",
4
4
  "description": "Shared Models JS Postgres",
5
5
  "main": "index.js",
6
6
  "license": "ISC",
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ await queryInterface.addColumn('SystemUsers', 'isActive', {
6
+ type: Sequelize.BOOLEAN,
7
+ defaultValue: true,
8
+ allowNull: false
9
+ })
10
+ await queryInterface.addColumn('SystemUsers', 'disabledAt', {
11
+ type: Sequelize.DATE,
12
+ allowNull: true
13
+ })
14
+ },
15
+
16
+ down: async (queryInterface) => {
17
+ await queryInterface.removeColumn('SystemUsers', 'isActive')
18
+ await queryInterface.removeColumn('SystemUsers', 'disabledAt')
19
+ }
20
+ };
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ const datesColumns = [
4
+ 'processedAt', 'enqueuedAt', 'failedAt', 'readAt', 'sentAt', 'deliveredAt'
5
+ ]
6
+ module.exports = {
7
+ async up (queryInterface, Sequelize) {
8
+
9
+ await queryInterface.addColumn('BotIterables', 'brokerMessageStatus', {
10
+ type: Sequelize.STRING(100),
11
+ allowNull: true
12
+ })
13
+
14
+ for (const columnName of datesColumns) {
15
+ await queryInterface.addColumn('BotIterables', columnName, {
16
+ type: Sequelize.DATE,
17
+ allowNull: true
18
+ })
19
+ }
20
+ },
21
+
22
+ async down (queryInterface) {
23
+ await queryInterface.removeColumn('BotIterables', 'brokerStatus')
24
+ for(const columnName of datesColumns) {
25
+ await queryInterface.removeColumn('BotIterables', columnName)
26
+ }
27
+ }
28
+ };
@@ -88,6 +88,34 @@ exports.model = (sequelize, DataType) => {
88
88
  type: DataType.JSON,
89
89
  allowNull: true
90
90
  },
91
+ processedAt: {
92
+ allowNull: true,
93
+ type: DataTypes.DATE
94
+ },
95
+ enqueuedAt: {
96
+ allowNull: true,
97
+ type: DataTypes.DATE
98
+ },
99
+ failedAt: {
100
+ allowNull: true,
101
+ type: DataTypes.DATE
102
+ },
103
+ readAt: {
104
+ allowNull: true,
105
+ type: DataTypes.DATE
106
+ },
107
+ sentAt: {
108
+ allowNull: true,
109
+ type: DataTypes.DATE
110
+ },
111
+ deliveredAt: {
112
+ allowNull: true,
113
+ type: DataTypes.DATE
114
+ },
115
+ brokerMessageStatus: {
116
+ type: DataType.STRING(100),
117
+ allowNull: true,
118
+ },
91
119
  brokerMessageId: {
92
120
  type: DataType.UUID,
93
121
  allowNull: true
@@ -32,10 +32,20 @@ exports.model = (sequelize, DataTypes) => {
32
32
  onDelete: 'RESTRICT',
33
33
  onUpdate: 'CASCADE',
34
34
  },
35
+
35
36
  maxSimultaneousAttendances: {
36
37
  type: DataTypes.INTEGER,
37
38
  allowNull: true,
38
39
  },
40
+ isActive: {
41
+ type: DataTypes.BOOLEAN,
42
+ default: true,
43
+ allowNull: false,
44
+ },
45
+ disabledAt: {
46
+ type: DataTypes.DATE,
47
+ allowNull: true,
48
+ }
39
49
  })
40
50
 
41
51
  SystemUsers.associate = models => {