@pintahub/database-schemas 1.9.8 → 2.0.0

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": "1.9.8",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,46 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const Media = new Schema({
5
+ store: {
6
+ type: Schema.Types.ObjectId,
7
+ index: true,
8
+ required: true,
9
+ },
10
+
11
+ id: {
12
+ type: String,
13
+ trim: true,
14
+ index: true,
15
+ },
16
+
17
+ url: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+
22
+ status: {
23
+ type: String,
24
+ trim: true,
25
+ index: true,
26
+ default: 'pending'
27
+ },
28
+
29
+ type: {
30
+ type: String,
31
+ trim: true,
32
+ default: 'image',
33
+ },
34
+
35
+ updated_at: {
36
+ type: Date,
37
+ default: Date.now
38
+ },
39
+
40
+ created_at: {
41
+ type: Date,
42
+ default: Date.now
43
+ }
44
+ })
45
+
46
+ module.exports = Media
@@ -182,6 +182,7 @@ const Product = new Schema({
182
182
 
183
183
  is_primary: {
184
184
  type: Boolean,
185
+ default: true,
185
186
  index: true,
186
187
  },
187
188