@itleanchatbot/shared-models-js-postgres 2.8.24 → 2.8.27
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 +1 -1
- package/src/migrations/20211119123119-CreateApiPreRequest.js +66 -66
- package/src/migrations/20220118131507-alter-table-SystemUsers-isActive.js +20 -20
- package/src/migrations/20220121145703-alter-table-botiterable.js +28 -28
- package/src/migrations/20220126141248-alter-table-sessions-session-start.js +14 -14
- package/src/migrations/20220215123711-alter-table-conversation-sessions.js +15 -15
- package/src/migrations/20220407191846-alter-table-dialog-nodes-type.js +34 -34
- package/src/migrations/20220413113609-alter-table-botiterable-action.js +24 -24
- package/src/migrations/20220503150629-create-table-blacklist-contacts.js +40 -0
- package/src/migrations/20220503150638-create-table-whitelist-contacts.js +40 -0
- package/src/migrations/20220524130822-alter-table-channel-title-icon-file.js +20 -0
- package/src/models/blacklistContacts.js +24 -0
- package/src/models/channels.js +10 -0
- package/src/models/faqQuestions.js +31 -31
- package/src/models/openFaqs.js +33 -33
- package/src/models/whitelistContacts.js +24 -0
- package/src/seeders/20220221142239-add-permissions-to-adm.js +98 -98
- package/src/seeders/test/20210224165819-create-skill-framework.js +41 -41
- package/src/seeders/test/20210301174809-create-dialog-node-framework.js +43 -43
- package/src/seeders/test/20211122141406-api-pre-request.js +201 -201
package/package.json
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
up: async (queryInterface, Sequelize) => {
|
|
5
|
-
await queryInterface.createTable('ApiPreRequests', {
|
|
6
|
-
id: {
|
|
7
|
-
allowNull: false,
|
|
8
|
-
defaultValue: Sequelize.literal('uuid_generate_v4()'),
|
|
9
|
-
primaryKey: true,
|
|
10
|
-
type: Sequelize.UUID,
|
|
11
|
-
},
|
|
12
|
-
ApiId: {
|
|
13
|
-
allowNull: true,
|
|
14
|
-
defaultValue: null,
|
|
15
|
-
type: Sequelize.UUID,
|
|
16
|
-
references: {
|
|
17
|
-
model: 'Apis',
|
|
18
|
-
key: 'id',
|
|
19
|
-
},
|
|
20
|
-
onDelete: 'SET NULL',
|
|
21
|
-
onUpdate: 'CASCADE',
|
|
22
|
-
},
|
|
23
|
-
ApiResourceId: {
|
|
24
|
-
allowNull: true,
|
|
25
|
-
defaultValue: null,
|
|
26
|
-
type: Sequelize.UUID,
|
|
27
|
-
references: {
|
|
28
|
-
model: 'ApiResources',
|
|
29
|
-
key: 'id',
|
|
30
|
-
},
|
|
31
|
-
onDelete: 'SET NULL',
|
|
32
|
-
onUpdate: 'CASCADE',
|
|
33
|
-
},
|
|
34
|
-
PreApiResourceId: {
|
|
35
|
-
allowNull: false,
|
|
36
|
-
type: Sequelize.UUID,
|
|
37
|
-
references: {
|
|
38
|
-
model: 'ApiResources',
|
|
39
|
-
key: 'id',
|
|
40
|
-
},
|
|
41
|
-
onDelete: 'SET NULL',
|
|
42
|
-
onUpdate: 'CASCADE',
|
|
43
|
-
},
|
|
44
|
-
result: {
|
|
45
|
-
allowNull: false,
|
|
46
|
-
type: Sequelize.STRING,
|
|
47
|
-
},
|
|
48
|
-
delayForNewRequest: {
|
|
49
|
-
allowNull: false,
|
|
50
|
-
type: Sequelize.STRING,
|
|
51
|
-
},
|
|
52
|
-
createdAt: {
|
|
53
|
-
allowNull: false,
|
|
54
|
-
type: Sequelize.DATE,
|
|
55
|
-
},
|
|
56
|
-
updatedAt: {
|
|
57
|
-
allowNull: false,
|
|
58
|
-
type: Sequelize.DATE,
|
|
59
|
-
},
|
|
60
|
-
})
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
down: async (queryInterface) => {
|
|
64
|
-
await queryInterface.dropTable('ApiPreRequests')
|
|
65
|
-
}
|
|
66
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, Sequelize) => {
|
|
5
|
+
await queryInterface.createTable('ApiPreRequests', {
|
|
6
|
+
id: {
|
|
7
|
+
allowNull: false,
|
|
8
|
+
defaultValue: Sequelize.literal('uuid_generate_v4()'),
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
type: Sequelize.UUID,
|
|
11
|
+
},
|
|
12
|
+
ApiId: {
|
|
13
|
+
allowNull: true,
|
|
14
|
+
defaultValue: null,
|
|
15
|
+
type: Sequelize.UUID,
|
|
16
|
+
references: {
|
|
17
|
+
model: 'Apis',
|
|
18
|
+
key: 'id',
|
|
19
|
+
},
|
|
20
|
+
onDelete: 'SET NULL',
|
|
21
|
+
onUpdate: 'CASCADE',
|
|
22
|
+
},
|
|
23
|
+
ApiResourceId: {
|
|
24
|
+
allowNull: true,
|
|
25
|
+
defaultValue: null,
|
|
26
|
+
type: Sequelize.UUID,
|
|
27
|
+
references: {
|
|
28
|
+
model: 'ApiResources',
|
|
29
|
+
key: 'id',
|
|
30
|
+
},
|
|
31
|
+
onDelete: 'SET NULL',
|
|
32
|
+
onUpdate: 'CASCADE',
|
|
33
|
+
},
|
|
34
|
+
PreApiResourceId: {
|
|
35
|
+
allowNull: false,
|
|
36
|
+
type: Sequelize.UUID,
|
|
37
|
+
references: {
|
|
38
|
+
model: 'ApiResources',
|
|
39
|
+
key: 'id',
|
|
40
|
+
},
|
|
41
|
+
onDelete: 'SET NULL',
|
|
42
|
+
onUpdate: 'CASCADE',
|
|
43
|
+
},
|
|
44
|
+
result: {
|
|
45
|
+
allowNull: false,
|
|
46
|
+
type: Sequelize.STRING,
|
|
47
|
+
},
|
|
48
|
+
delayForNewRequest: {
|
|
49
|
+
allowNull: false,
|
|
50
|
+
type: Sequelize.STRING,
|
|
51
|
+
},
|
|
52
|
+
createdAt: {
|
|
53
|
+
allowNull: false,
|
|
54
|
+
type: Sequelize.DATE,
|
|
55
|
+
},
|
|
56
|
+
updatedAt: {
|
|
57
|
+
allowNull: false,
|
|
58
|
+
type: Sequelize.DATE,
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
down: async (queryInterface) => {
|
|
64
|
+
await queryInterface.dropTable('ApiPreRequests')
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -1,20 +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
|
-
};
|
|
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
|
+
};
|
|
@@ -1,28 +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
|
-
};
|
|
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
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
async up (queryInterface, Sequelize) {
|
|
5
|
-
await queryInterface.addColumn('Sessions', 'startedSessionAt', {
|
|
6
|
-
type: Sequelize.DATE,
|
|
7
|
-
allowNull: true
|
|
8
|
-
})
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
async down (queryInterface) {
|
|
12
|
-
await queryInterface.removeColumn('Sessions', 'startedSessionAt')
|
|
13
|
-
}
|
|
14
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up (queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.addColumn('Sessions', 'startedSessionAt', {
|
|
6
|
+
type: Sequelize.DATE,
|
|
7
|
+
allowNull: true
|
|
8
|
+
})
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
async down (queryInterface) {
|
|
12
|
+
await queryInterface.removeColumn('Sessions', 'startedSessionAt')
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
up: async (queryInterface, Sequelize) => {
|
|
5
|
-
await queryInterface.addColumn('ConversationSessions', 'isHsm', {
|
|
6
|
-
allowNull: false,
|
|
7
|
-
defaultValue: false,
|
|
8
|
-
type: Sequelize.BOOLEAN,
|
|
9
|
-
})
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
down: async (queryInterface) => {
|
|
13
|
-
await queryInterface.removeColumn('ConversationSessions', 'isHsm')
|
|
14
|
-
}
|
|
15
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, Sequelize) => {
|
|
5
|
+
await queryInterface.addColumn('ConversationSessions', 'isHsm', {
|
|
6
|
+
allowNull: false,
|
|
7
|
+
defaultValue: false,
|
|
8
|
+
type: Sequelize.BOOLEAN,
|
|
9
|
+
})
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
down: async (queryInterface) => {
|
|
13
|
+
await queryInterface.removeColumn('ConversationSessions', 'isHsm')
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { DIALOG_NODE_TYPES } = require('./../models/dialogNodes')
|
|
4
|
-
const { replaceEnum } = require('./../presenters/database/migrationHelpers')
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
async up (queryInterface) {
|
|
8
|
-
await replaceEnum(
|
|
9
|
-
queryInterface,
|
|
10
|
-
'DialogNodes',
|
|
11
|
-
'type',
|
|
12
|
-
DIALOG_NODE_TYPES.CALLBACK,
|
|
13
|
-
DIALOG_NODE_TYPES.NODE,
|
|
14
|
-
DIALOG_NODE_TYPES.FOLDER,
|
|
15
|
-
DIALOG_NODE_TYPES.TRANSHIP,
|
|
16
|
-
DIALOG_NODE_TYPES.FAQ,
|
|
17
|
-
DIALOG_NODE_TYPES.END_SESSION
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
async down (queryInterface) {
|
|
23
|
-
await replaceEnum(
|
|
24
|
-
queryInterface,
|
|
25
|
-
'DialogNodes',
|
|
26
|
-
'type',
|
|
27
|
-
DIALOG_NODE_TYPES.NODE,
|
|
28
|
-
DIALOG_NODE_TYPES.FOLDER,
|
|
29
|
-
DIALOG_NODE_TYPES.TRANSHIP,
|
|
30
|
-
DIALOG_NODE_TYPES.FAQ,
|
|
31
|
-
DIALOG_NODE_TYPES.END_SESSION,
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { DIALOG_NODE_TYPES } = require('./../models/dialogNodes')
|
|
4
|
+
const { replaceEnum } = require('./../presenters/database/migrationHelpers')
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
async up (queryInterface) {
|
|
8
|
+
await replaceEnum(
|
|
9
|
+
queryInterface,
|
|
10
|
+
'DialogNodes',
|
|
11
|
+
'type',
|
|
12
|
+
DIALOG_NODE_TYPES.CALLBACK,
|
|
13
|
+
DIALOG_NODE_TYPES.NODE,
|
|
14
|
+
DIALOG_NODE_TYPES.FOLDER,
|
|
15
|
+
DIALOG_NODE_TYPES.TRANSHIP,
|
|
16
|
+
DIALOG_NODE_TYPES.FAQ,
|
|
17
|
+
DIALOG_NODE_TYPES.END_SESSION
|
|
18
|
+
|
|
19
|
+
)
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
async down (queryInterface) {
|
|
23
|
+
await replaceEnum(
|
|
24
|
+
queryInterface,
|
|
25
|
+
'DialogNodes',
|
|
26
|
+
'type',
|
|
27
|
+
DIALOG_NODE_TYPES.NODE,
|
|
28
|
+
DIALOG_NODE_TYPES.FOLDER,
|
|
29
|
+
DIALOG_NODE_TYPES.TRANSHIP,
|
|
30
|
+
DIALOG_NODE_TYPES.FAQ,
|
|
31
|
+
DIALOG_NODE_TYPES.END_SESSION,
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const { replaceEnum } = require('./../presenters/database/migrationHelpers')
|
|
3
|
-
module.exports = {
|
|
4
|
-
async up (queryInterface) {
|
|
5
|
-
await replaceEnum(
|
|
6
|
-
queryInterface,
|
|
7
|
-
'BotIterables',
|
|
8
|
-
'action',
|
|
9
|
-
'bot',
|
|
10
|
-
'client',
|
|
11
|
-
'callback',
|
|
12
|
-
)
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
async down (queryInterface) {
|
|
16
|
-
await replaceEnum(
|
|
17
|
-
queryInterface,
|
|
18
|
-
'BotIterables',
|
|
19
|
-
'action',
|
|
20
|
-
'bot',
|
|
21
|
-
'client'
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
const { replaceEnum } = require('./../presenters/database/migrationHelpers')
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up (queryInterface) {
|
|
5
|
+
await replaceEnum(
|
|
6
|
+
queryInterface,
|
|
7
|
+
'BotIterables',
|
|
8
|
+
'action',
|
|
9
|
+
'bot',
|
|
10
|
+
'client',
|
|
11
|
+
'callback',
|
|
12
|
+
)
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
async down (queryInterface) {
|
|
16
|
+
await replaceEnum(
|
|
17
|
+
queryInterface,
|
|
18
|
+
'BotIterables',
|
|
19
|
+
'action',
|
|
20
|
+
'bot',
|
|
21
|
+
'client'
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, Sequelize) => {
|
|
5
|
+
await queryInterface.createTable('BlacklistContacts', {
|
|
6
|
+
id: {
|
|
7
|
+
allowNull: false,
|
|
8
|
+
defaultValue: Sequelize.literal('uuid_generate_v4()'),
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
type: Sequelize.UUID,
|
|
11
|
+
},
|
|
12
|
+
ChannelId: {
|
|
13
|
+
type: Sequelize.UUID,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
references: {
|
|
16
|
+
model: 'Channels',
|
|
17
|
+
key: 'id',
|
|
18
|
+
},
|
|
19
|
+
onDelete: 'RESTRICT',
|
|
20
|
+
onUpdate: 'CASCADE',
|
|
21
|
+
},
|
|
22
|
+
contact: {
|
|
23
|
+
allowNull: false,
|
|
24
|
+
type: Sequelize.STRING(255)
|
|
25
|
+
},
|
|
26
|
+
createdAt: {
|
|
27
|
+
allowNull: false,
|
|
28
|
+
type: Sequelize.DATE,
|
|
29
|
+
},
|
|
30
|
+
updatedAt: {
|
|
31
|
+
allowNull: false,
|
|
32
|
+
type: Sequelize.DATE,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
down: async (queryInterface) => {
|
|
38
|
+
await queryInterface.dropTable('BlacklistContacts')
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
up: async (queryInterface, Sequelize) => {
|
|
5
|
+
await queryInterface.createTable('WhitelistContacts', {
|
|
6
|
+
id: {
|
|
7
|
+
allowNull: false,
|
|
8
|
+
defaultValue: Sequelize.literal('uuid_generate_v4()'),
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
type: Sequelize.UUID,
|
|
11
|
+
},
|
|
12
|
+
ChannelId: {
|
|
13
|
+
type: Sequelize.UUID,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
references: {
|
|
16
|
+
model: 'Channels',
|
|
17
|
+
key: 'id',
|
|
18
|
+
},
|
|
19
|
+
onDelete: 'RESTRICT',
|
|
20
|
+
onUpdate: 'CASCADE',
|
|
21
|
+
},
|
|
22
|
+
contact: {
|
|
23
|
+
allowNull: false,
|
|
24
|
+
type: Sequelize.STRING(255)
|
|
25
|
+
},
|
|
26
|
+
createdAt: {
|
|
27
|
+
allowNull: false,
|
|
28
|
+
type: Sequelize.DATE,
|
|
29
|
+
},
|
|
30
|
+
updatedAt: {
|
|
31
|
+
allowNull: false,
|
|
32
|
+
type: Sequelize.DATE,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
down: async (queryInterface) => {
|
|
38
|
+
await queryInterface.dropTable('WhitelistContacts')
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up (queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.addColumn('Channels', 'TitleIconFileId', {
|
|
6
|
+
type: Sequelize.UUID,
|
|
7
|
+
allowNull: true,
|
|
8
|
+
references: {
|
|
9
|
+
model: 'Files',
|
|
10
|
+
key: 'id',
|
|
11
|
+
},
|
|
12
|
+
onDelete: 'RESTRICT',
|
|
13
|
+
onUpdate: 'CASCADE',
|
|
14
|
+
})
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
async down (queryInterface) {
|
|
18
|
+
await queryInterface.removeColumn('Channels', 'TitleIconFileId')
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
exports.model = (sequelize, Sequelize) => {
|
|
2
|
+
const BlacklistContacts = sequelize.define('BlacklistContacts', {
|
|
3
|
+
ChannelId: {
|
|
4
|
+
type: Sequelize.UUID,
|
|
5
|
+
allowNull: true,
|
|
6
|
+
references: {
|
|
7
|
+
model: 'Channels',
|
|
8
|
+
key: 'id',
|
|
9
|
+
},
|
|
10
|
+
onDelete: 'RESTRICT',
|
|
11
|
+
onUpdate: 'CASCADE',
|
|
12
|
+
},
|
|
13
|
+
contact: {
|
|
14
|
+
allowNull: false,
|
|
15
|
+
type: Sequelize.STRING(255)
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
BlacklistContacts.associate = models => {
|
|
20
|
+
BlacklistContacts.belongsTo(models.Channels)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return BlacklistContacts
|
|
24
|
+
}
|
package/src/models/channels.js
CHANGED
|
@@ -30,6 +30,16 @@ exports.model = (sequelize, DataTypes) => {
|
|
|
30
30
|
onDelete: 'RESTRICT',
|
|
31
31
|
onUpdate: 'CASCADE',
|
|
32
32
|
},
|
|
33
|
+
TitleIconFileId: {
|
|
34
|
+
type: DataTypes.UUID,
|
|
35
|
+
allowNull: true,
|
|
36
|
+
references: {
|
|
37
|
+
model: 'Files',
|
|
38
|
+
key: 'id',
|
|
39
|
+
},
|
|
40
|
+
onDelete: 'RESTRICT',
|
|
41
|
+
onUpdate: 'CASCADE',
|
|
42
|
+
},
|
|
33
43
|
name: {
|
|
34
44
|
type: DataTypes.STRING(50),
|
|
35
45
|
allowNull: false,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
exports.model = (sequelize, Sequelize) => {
|
|
2
|
-
const OpenFAQs = sequelize.define('FaqQuestions', {
|
|
3
|
-
name: {
|
|
4
|
-
type: Sequelize.STRING(255),
|
|
5
|
-
allowNull: false,
|
|
6
|
-
validate: {
|
|
7
|
-
notEmpty: true,
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
OpenFAQId: {
|
|
11
|
-
type: Sequelize.UUID,
|
|
12
|
-
allowNull: false,
|
|
13
|
-
references: {
|
|
14
|
-
model: 'OpenFAQs',
|
|
15
|
-
key: 'id',
|
|
16
|
-
},
|
|
17
|
-
onDelete: 'CASCADE',
|
|
18
|
-
onUpdate: 'CASCADE',
|
|
19
|
-
foreignKeyConstraint: true,
|
|
20
|
-
validate: {
|
|
21
|
-
notEmpty: true,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
OpenFAQs.associate = (models) => {
|
|
27
|
-
OpenFAQs.belongsTo(models.OpenFAQs)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return OpenFAQs
|
|
31
|
-
}
|
|
1
|
+
exports.model = (sequelize, Sequelize) => {
|
|
2
|
+
const OpenFAQs = sequelize.define('FaqQuestions', {
|
|
3
|
+
name: {
|
|
4
|
+
type: Sequelize.STRING(255),
|
|
5
|
+
allowNull: false,
|
|
6
|
+
validate: {
|
|
7
|
+
notEmpty: true,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
OpenFAQId: {
|
|
11
|
+
type: Sequelize.UUID,
|
|
12
|
+
allowNull: false,
|
|
13
|
+
references: {
|
|
14
|
+
model: 'OpenFAQs',
|
|
15
|
+
key: 'id',
|
|
16
|
+
},
|
|
17
|
+
onDelete: 'CASCADE',
|
|
18
|
+
onUpdate: 'CASCADE',
|
|
19
|
+
foreignKeyConstraint: true,
|
|
20
|
+
validate: {
|
|
21
|
+
notEmpty: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
OpenFAQs.associate = (models) => {
|
|
27
|
+
OpenFAQs.belongsTo(models.OpenFAQs)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return OpenFAQs
|
|
31
|
+
}
|