Skip to content

Commit 7ad75ea

Browse files
committed
chore(parser): The date in the database is now in TIMESTAMP format
1 parent 643518d commit 7ad75ea

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

parser/services/coinmarketcap.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ module.exports = {
3737
from_currency: fromCurrency,
3838
conv_currency: convCurrency,
3939
rate: data.price,
40-
date: new Date(data['last_updated'])
41-
.toISOString()
42-
.substring(0, 10),
40+
date: data['last_updated'],
4341
};
4442
})
4543
.catch((err) => {

parser/services/duckduckgo.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ module.exports = {
3232
from_currency: fromCurrency,
3333
conv_currency: convCurrency,
3434
rate: rate,
35-
date: new Date(data['timestamp'])
36-
.toISOString()
37-
.substring(0, 10),
35+
date: data['timestamp'],
3836
};
3937
})
4038
.catch((err) => {

schemas/data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS currency(
22
from_currency TEXT NOT NULL,
33
conv_currency TEXT NOT NULL,
44
rate NUMERIC NOT NULL,
5-
date DATE NOT NULL
5+
date TIMESTAMP NOT NULL
66
);
77

88
CREATE INDEX IF NOT EXISTS currency_from_currency_conv_currency_idx

0 commit comments

Comments
 (0)