From 31d8a07b97ccb136cc2614b553e37e31cc4fcae9 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Tue, 22 Aug 2017 22:15:40 +0300 Subject: [PATCH] Keep track of USD value update datetime in DB --- .../20170822212911-store-usd-value-updated-datetime.down.sql | 0 .../20170822212911-store-usd-value-updated-datetime.up.sql | 1 + resources/sql/queries.sql | 3 ++- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 resources/migrations/20170822212911-store-usd-value-updated-datetime.down.sql create mode 100644 resources/migrations/20170822212911-store-usd-value-updated-datetime.up.sql diff --git a/resources/migrations/20170822212911-store-usd-value-updated-datetime.down.sql b/resources/migrations/20170822212911-store-usd-value-updated-datetime.down.sql new file mode 100644 index 0000000..e69de29 diff --git a/resources/migrations/20170822212911-store-usd-value-updated-datetime.up.sql b/resources/migrations/20170822212911-store-usd-value-updated-datetime.up.sql new file mode 100644 index 0000000..9ba362c --- /dev/null +++ b/resources/migrations/20170822212911-store-usd-value-updated-datetime.up.sql @@ -0,0 +1 @@ +ALTER TABLE "public"."issues" ADD COLUMN "value_usd_updated" timestamp without time zone; diff --git a/resources/sql/queries.sql b/resources/sql/queries.sql index 4fdbfbf..e25dc94 100644 --- a/resources/sql/queries.sql +++ b/resources/sql/queries.sql @@ -342,7 +342,8 @@ WHERE contract_address = :contract_address; -- :name update-usd-value :! :n -- :doc updates issue with given USD value UPDATE issues -SET value_usd = :usd_value +SET value_usd = :usd_value, +value_usd_updated = timezone('utc'::text, now()) WHERE contract_address = :contract_address;