agrs-sequelize-sdk 1.0.36 → 1.0.38

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/models/Ad.js CHANGED
@@ -152,7 +152,7 @@ module.exports = (sequelize, DataTypes) => {
152
152
  // Save current state to AdHistory
153
153
  await sequelize.models.AdHistory.create({
154
154
  AdID: ad.AdID,
155
- DataSnapshot: ad.get(), // Save the full Ad data as JSON
155
+ DataSnapshot: ad._previousDataValues, // Save the full Ad data as JSON
156
156
  });
157
157
  } else if (ad.previous('publish') === false && ad.publish === true) {
158
158
  // Delete the latest history entry
package/models/AdSet.js CHANGED
@@ -86,7 +86,7 @@ module.exports = (sequelize, DataTypes) => {
86
86
  // Save current state to AdSetHistory
87
87
  await sequelize.models.AdSetHistory.create({
88
88
  AdSetID: adSet.AdSetID,
89
- DataSnapshot: adSet.get(), // Save the full AdSet data as JSON
89
+ DataSnapshot: adSet._previousDataValues, // Save the full AdSet data as JSON
90
90
  });
91
91
  } else if (adSet.previous('publish') === false && adSet.publish === true) {
92
92
  // Delete the latest history entry
@@ -88,7 +88,7 @@ module.exports = (sequelize, DataTypes) => {
88
88
  // Save current state to CampaignHistory
89
89
  await sequelize.models.CampaignHistory.create({
90
90
  CampaignID: campaign.CampaignID,
91
- DataSnapshot: campaign.get(), // Store current state as JSON
91
+ DataSnapshot: campaign._previousDataValues, // Store current state as JSON
92
92
  });
93
93
  } else if (campaign.previous('publish') === false && campaign.publish === true) {
94
94
  // Delete the latest history entry
package/models/Users.js CHANGED
@@ -4,10 +4,10 @@ module.exports = (sequelize, DataTypes) => {
4
4
  "Users",
5
5
  {
6
6
  id: {
7
- type: DataTypes.INTEGER, // Use INTEGER for auto-incrementing ID
8
- autoIncrement: true, // Automatically increment the value
7
+ type: DataTypes.UUID, // Use UUID for the primary key
8
+ defaultValue: DataTypes.UUIDV4, // Automatically generate a UUID
9
9
  primaryKey: true, // Set as primary key
10
- },
10
+ },
11
11
  Username: {
12
12
  type: DataTypes.STRING,
13
13
  allowNull: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",