diff --git a/classes/postgres.ts b/classes/postgres.ts index cf0da15..bd5df4d 100644 --- a/classes/postgres.ts +++ b/classes/postgres.ts @@ -6,9 +6,9 @@ const connectionString = process.env.DATABASE_URL + "?ssl=true"; const client = new Client({ connectionString: connectionString }); -client.connect(function(err, client, done){ - console.log(err) - console.log(done) +client.connect(function(err, client, done) { + console.log(err); + console.log(done); }); console.log("Successfully connected to Postgres"); diff --git a/worker.js b/worker.js index af01dc4..4744087 100644 --- a/worker.js +++ b/worker.js @@ -200,7 +200,9 @@ function insertNewValue(parsedUserValue, ctx, key, type, fakeDate) { Question: questionText, Type: type, Value: parsedUserValue, - Source: "telegram" + Source: "telegram", + Importedat: moment(ctx.update.message.date * 1000), + Importid: null }; postgres.client.query({ text: "INSERT INTO raw_data (" + diff --git a/worker.ts b/worker.ts index be683bc..70f02dc 100644 --- a/worker.ts +++ b/worker.ts @@ -256,7 +256,9 @@ function insertNewValue(parsedUserValue, ctx, key, type, fakeDate = null) { Question: questionText, Type: type, Value: parsedUserValue, - Source: "telegram" + Source: "telegram", + Importedat: moment(ctx.update.message.date * 1000), + Importid: null }; postgres.client.query(