File tree Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const mongoose = require ( 'mongoose' )
4
+ const Schema = mongoose . Schema
5
+
6
+ const Block = new Schema ( {
7
+ hash : {
8
+ type : String ,
9
+ index : true ,
10
+ unique : true
11
+ } ,
12
+ blockNumber : {
13
+ type : Number ,
14
+ index : true ,
15
+ unique : true
16
+ } ,
17
+ transactionCount : {
18
+ type : Number ,
19
+ index : true
20
+ } ,
21
+ parentHash : {
22
+ type : String
23
+ } ,
24
+ timestamp : {
25
+ type : Number
26
+ }
27
+ } , { timestamps : false } )
28
+
29
+ module . exports = mongoose . model ( 'Block' , Block )
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ const Schema = mongoose.Schema
6
6
const Transaction = new Schema ( {
7
7
hash : {
8
8
type : String ,
9
- index : true ,
10
- unique : true
9
+ index : true
11
10
} ,
12
11
block : {
13
12
type : Number ,
@@ -23,10 +22,7 @@ const Transaction = new Schema({
23
22
} ,
24
23
tokenAmount : {
25
24
type : Number
26
- } ,
27
- isProcess : {
28
- type : Boolean
29
25
}
30
- } , { timestamps : true } )
26
+ } , { timestamps : false } )
31
27
32
28
module . exports = mongoose . model ( 'Transaction' , Transaction )
Original file line number Diff line number Diff line change @@ -17,6 +17,6 @@ const Wallet = new Schema({
17
17
type : Number ,
18
18
index : true
19
19
}
20
- } , { timestamps : true } )
20
+ } , { timestamps : false } )
21
21
22
22
module . exports = mongoose . model ( 'Wallet' , Wallet )
You can’t perform that action at this time.
0 commit comments