@pintahub/database-schemas 2.8.9 → 2.9.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": "2.8.9",
3
+ "version": "2.9.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,29 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const ShortDomain = new Schema({
5
+ domain: {
6
+ type: String,
7
+ trim: true,
8
+ index: true,
9
+ },
10
+
11
+ status: {
12
+ type: String,
13
+ index: true,
14
+ default: 'active'
15
+ },
16
+
17
+ updated_at: {
18
+ type: Date,
19
+ default: Date.now
20
+ },
21
+
22
+ created_at: {
23
+ type: Date,
24
+ default: Date.now
25
+ }
26
+ })
27
+
28
+ module.exports = ShortDomain
29
+
@@ -0,0 +1,58 @@
1
+ const {Schema} = require('mongoose')
2
+
3
+
4
+ const ShortLink = new Schema({
5
+ url: {
6
+ type: String,
7
+ trim: true,
8
+ required: true
9
+ },
10
+
11
+ slug: {
12
+ type: String,
13
+ trim: true,
14
+ index: true
15
+ },
16
+
17
+ domain: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+
22
+ domain_id: {
23
+ type: Schema.Types.ObjectId,
24
+ index: true,
25
+ },
26
+
27
+ status: {
28
+ type: String,
29
+ index: true,
30
+ default: 'active'
31
+ },
32
+
33
+ edited_by: {
34
+ type: Schema.Types.ObjectId,
35
+ },
36
+
37
+ created_by: {
38
+ type: Schema.Types.ObjectId,
39
+ index: true,
40
+ },
41
+
42
+ updated_at: {
43
+ type: Date,
44
+ default: Date.now
45
+ },
46
+
47
+ created_at: {
48
+ type: Date,
49
+ default: Date.now
50
+ }
51
+ })
52
+
53
+ ShortLink.index({
54
+ slug: 1,
55
+ domain: 1
56
+ })
57
+
58
+ module.exports = ShortLink