@itleanchatbot/shared-models-js-postgres 1.1.90 → 1.1.91

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/stopwords.js +47 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itleanchatbot/shared-models-js-postgres",
3
- "version": "1.1.90",
3
+ "version": "1.1.91",
4
4
  "description": "Shared Models JS Postgres",
5
5
  "main": "index.js",
6
6
  "license": "ISC",
@@ -0,0 +1,47 @@
1
+
2
+ const StopwordsModel = (sequelize, types) => {
3
+ const Stopwords = sequelize.define('Stopwords', {
4
+ id: {
5
+ allowNull: false,
6
+ defaultValue: Sequelize.literal('uuid_generate_v4()'),
7
+ primaryKey: true,
8
+ type: types.UUID,
9
+ },
10
+ SkillId: {
11
+ allowNull: true,
12
+ type: types.UUID,
13
+ references: {
14
+ model: 'Skills',
15
+ key: 'id',
16
+ },
17
+ onDelete: 'SET NULL',
18
+ onUpdate: 'CASCADE',
19
+ },
20
+ EnterpriseId: {
21
+ allowNull: true,
22
+ type: types.UUID,
23
+ references: {
24
+ model: 'Enterprises',
25
+ key: 'id',
26
+ },
27
+ onDelete: 'SET NULL',
28
+ onUpdate: 'CASCADE',
29
+ },
30
+ words: {
31
+ allowNull: false,
32
+ type: types.ARRAY(types.STRING),
33
+ },
34
+ })
35
+
36
+ Stopwords.associate = models => {
37
+ Stopwords.belongsTo(models.Skill)
38
+ Stopwords.belongsTo(models.Enterprises)
39
+ }
40
+
41
+ return Stopwords
42
+ }
43
+
44
+ module.exports = {
45
+ StopwordsModel
46
+ }
47
+