@pintahub/database-schemas 3.7.9 → 3.8.1

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": "@pintahub/database-schemas",
3
- "version": "3.7.9",
3
+ "version": "3.8.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,31 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const FavoriteItem = new Schema({
5
+ store: {
6
+ type: Schema.Types.ObjectId,
7
+ index: true,
8
+ required: true,
9
+ },
10
+
11
+ session_id: {
12
+ type: String,
13
+ trim: true,
14
+ index: true,
15
+ required: true,
16
+ },
17
+
18
+ product: {
19
+ type: Schema.Types.ObjectId,
20
+ required: true,
21
+ },
22
+
23
+ created_at: {
24
+ type: Date,
25
+ default: Date.now,
26
+ index: true,
27
+ }
28
+ })
29
+
30
+ module.exports = FavoriteItem
31
+
@@ -296,6 +296,7 @@ const Product = new Schema({
296
296
  external_id: {//For id when import from external source
297
297
  type: String,
298
298
  trim: true,
299
+ index: true,
299
300
  },
300
301
 
301
302
  deleted_at: {