agrs-sequelize-sdk 1.2.46 → 1.2.47

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.
@@ -1,17 +1,17 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- await queryInterface.addColumn("articles", "requestedFromDashboard", {
6
- type: Sequelize.BOOLEAN,
7
- allowNull: false,
8
- defaultValue: false,
9
- comment:
10
- "Indicates if the article was created through our dashboard (true) or imported from external sources (false)",
11
- });
12
- },
13
-
14
- down: async (queryInterface, Sequelize) => {
15
- await queryInterface.removeColumn("articles", "requestedFromDashboard");
16
- },
17
- };
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ await queryInterface.addColumn("articles", "requestedFromDashboard", {
6
+ type: Sequelize.BOOLEAN,
7
+ allowNull: false,
8
+ defaultValue: false,
9
+ comment:
10
+ "Indicates if the article was created through our dashboard (true) or imported from external sources (false)",
11
+ });
12
+ },
13
+
14
+ down: async (queryInterface, Sequelize) => {
15
+ await queryInterface.removeColumn("articles", "requestedFromDashboard");
16
+ },
17
+ };
@@ -1,26 +1,26 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const AdAccountValues = sequelize.define(
3
- "AdAccountValues",
4
- {
5
- id: {
6
- type: DataTypes.UUID,
7
- defaultValue: DataTypes.UUIDV4,
8
- primaryKey: true,
9
- },
10
- name: {
11
- type: DataTypes.STRING,
12
- allowNull: false,
13
- },
14
- code: {
15
- type: DataTypes.STRING,
16
- allowNull: false,
17
- unique: true,
18
- },
19
- },
20
- {
21
- tableName: "AdAccountValues",
22
- }
23
- );
24
-
25
- return AdAccountValues;
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const AdAccountValues = sequelize.define(
3
+ "AdAccountValues",
4
+ {
5
+ id: {
6
+ type: DataTypes.UUID,
7
+ defaultValue: DataTypes.UUIDV4,
8
+ primaryKey: true,
9
+ },
10
+ name: {
11
+ type: DataTypes.STRING,
12
+ allowNull: false,
13
+ },
14
+ code: {
15
+ type: DataTypes.STRING,
16
+ allowNull: false,
17
+ unique: true,
18
+ },
19
+ },
20
+ {
21
+ tableName: "AdAccountValues",
22
+ }
23
+ );
24
+
25
+ return AdAccountValues;
26
26
  };
@@ -1,30 +1,30 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const AdHistory = sequelize.define(
3
- "AdHistory",
4
- {
5
- HistoryID: {
6
- type: DataTypes.UUID,
7
- defaultValue: DataTypes.UUIDV4,
8
- primaryKey: true,
9
- },
10
- AdID: {
11
- type: DataTypes.STRING,
12
- allowNull: false,
13
- },
14
- DataSnapshot: {
15
- type: DataTypes.JSONB, // Store the full Ad row as a JSON object
16
- allowNull: false,
17
- },
18
- timestamp: {
19
- type: DataTypes.DATE,
20
- defaultValue: DataTypes.NOW,
21
- },
22
- },
23
- {
24
- tableName: "AdHistory",
25
- timestamps: false, // Disable Sequelize timestamps
26
- }
27
- );
28
-
29
- return AdHistory;
30
- };
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const AdHistory = sequelize.define(
3
+ "AdHistory",
4
+ {
5
+ HistoryID: {
6
+ type: DataTypes.UUID,
7
+ defaultValue: DataTypes.UUIDV4,
8
+ primaryKey: true,
9
+ },
10
+ AdID: {
11
+ type: DataTypes.STRING,
12
+ allowNull: false,
13
+ },
14
+ DataSnapshot: {
15
+ type: DataTypes.JSONB, // Store the full Ad row as a JSON object
16
+ allowNull: false,
17
+ },
18
+ timestamp: {
19
+ type: DataTypes.DATE,
20
+ defaultValue: DataTypes.NOW,
21
+ },
22
+ },
23
+ {
24
+ tableName: "AdHistory",
25
+ timestamps: false, // Disable Sequelize timestamps
26
+ }
27
+ );
28
+
29
+ return AdHistory;
30
+ };
@@ -1,89 +1,89 @@
1
- module.exports = (sequelize, DataTypes) => {
2
- const AdPerformance = sequelize.define(
3
- "AdPerformance",
4
- {
5
- Date: {
6
- type: DataTypes.DATEONLY,
7
- primaryKey: true,
8
- },
9
- AdID: {
10
- type: DataTypes.STRING,
11
- allowNull: false,
12
- primaryKey: true,
13
- },
14
- AmountSpent: {
15
- type: DataTypes.FLOAT,
16
- allowNull: true,
17
- },
18
- Impressions: {
19
- type: DataTypes.INTEGER,
20
- allowNull: true,
21
- },
22
- LinkClicks: {
23
- type: DataTypes.INTEGER,
24
- allowNull: true,
25
- },
26
- Revenue: {
27
- type: DataTypes.FLOAT,
28
- allowNull: true,
29
- },
30
- AdClicks: {
31
- type: DataTypes.INTEGER,
32
- allowNull: true,
33
- },
34
- Sessions: {
35
- type: DataTypes.INTEGER,
36
- allowNull: true,
37
- },
38
- ViewContent: {
39
- // New field
40
- type: DataTypes.INTEGER,
41
- allowNull: true,
42
- },
43
- Search: {
44
- // New field
45
- type: DataTypes.INTEGER,
46
- allowNull: true,
47
- },
48
- Purchase: {
49
- // New field
50
- type: DataTypes.INTEGER,
51
- allowNull: true,
52
- },
53
- Lead: {
54
- // New field
55
- type: DataTypes.INTEGER,
56
- allowNull: true,
57
- },
58
- originalSpend: {
59
- type: DataTypes.FLOAT,
60
- allowNull: true,
61
- },
62
- originRevenue: {
63
- type: DataTypes.FLOAT,
64
- allowNull: true,
65
- },
66
- },
67
- {
68
- tableName: "AdPerformance",
69
- indexes: [
70
- {
71
- unique: true,
72
- fields: ["AdID", "Date"], // Composite unique index
73
- },
74
- {
75
- fields: ["Date"], // Index on Date for faster range queries
76
- },
77
- {
78
- fields: ["AdID"], // Index on AdID for faster join
79
- },
80
- ],
81
- }
82
- );
83
-
84
- AdPerformance.associate = (models) => {
85
- AdPerformance.belongsTo(models.Ad, { foreignKey: "AdID" });
86
- };
87
-
88
- return AdPerformance;
89
- };
1
+ module.exports = (sequelize, DataTypes) => {
2
+ const AdPerformance = sequelize.define(
3
+ "AdPerformance",
4
+ {
5
+ Date: {
6
+ type: DataTypes.DATEONLY,
7
+ primaryKey: true,
8
+ },
9
+ AdID: {
10
+ type: DataTypes.STRING,
11
+ allowNull: false,
12
+ primaryKey: true,
13
+ },
14
+ AmountSpent: {
15
+ type: DataTypes.FLOAT,
16
+ allowNull: true,
17
+ },
18
+ Impressions: {
19
+ type: DataTypes.INTEGER,
20
+ allowNull: true,
21
+ },
22
+ LinkClicks: {
23
+ type: DataTypes.INTEGER,
24
+ allowNull: true,
25
+ },
26
+ Revenue: {
27
+ type: DataTypes.FLOAT,
28
+ allowNull: true,
29
+ },
30
+ AdClicks: {
31
+ type: DataTypes.INTEGER,
32
+ allowNull: true,
33
+ },
34
+ Sessions: {
35
+ type: DataTypes.INTEGER,
36
+ allowNull: true,
37
+ },
38
+ ViewContent: {
39
+ // New field
40
+ type: DataTypes.INTEGER,
41
+ allowNull: true,
42
+ },
43
+ Search: {
44
+ // New field
45
+ type: DataTypes.INTEGER,
46
+ allowNull: true,
47
+ },
48
+ Purchase: {
49
+ // New field
50
+ type: DataTypes.INTEGER,
51
+ allowNull: true,
52
+ },
53
+ Lead: {
54
+ // New field
55
+ type: DataTypes.INTEGER,
56
+ allowNull: true,
57
+ },
58
+ originalSpend: {
59
+ type: DataTypes.FLOAT,
60
+ allowNull: true,
61
+ },
62
+ originRevenue: {
63
+ type: DataTypes.FLOAT,
64
+ allowNull: true,
65
+ },
66
+ },
67
+ {
68
+ tableName: "AdPerformance",
69
+ indexes: [
70
+ {
71
+ unique: true,
72
+ fields: ["AdID", "Date"], // Composite unique index
73
+ },
74
+ {
75
+ fields: ["Date"], // Index on Date for faster range queries
76
+ },
77
+ {
78
+ fields: ["AdID"], // Index on AdID for faster join
79
+ },
80
+ ],
81
+ }
82
+ );
83
+
84
+ AdPerformance.associate = (models) => {
85
+ AdPerformance.belongsTo(models.Ad, { foreignKey: "AdID" });
86
+ };
87
+
88
+ return AdPerformance;
89
+ };