From 4467ee1b1bec173ba683b677f8a49ef30a441995 Mon Sep 17 00:00:00 2001 From: Martin Carlsson Date: Thu, 14 Jan 2021 11:51:26 +0100 Subject: [PATCH] P5-6518 add currency to markets (#170) --- migrations/000.285.sql | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 migrations/000.285.sql diff --git a/migrations/000.285.sql b/migrations/000.285.sql new file mode 100644 index 0000000..750012c --- /dev/null +++ b/migrations/000.285.sql @@ -0,0 +1,30 @@ +-- P5-6518: add currency to markets + +alter table markets + add column currency text; + + +alter table markets + add constraint currency_fkey + foreign key (currency) + references "product-currencies" (iso3char) match simple; + + +update markets set currency = 'SEK' where name = 'SE'; +update markets set currency = 'NOK' where name = 'NO'; +update markets set currency = 'GBP' where name = 'GB'; +update markets set currency = 'DKK' where name = 'DK'; +update markets set currency = 'EUR' where name = 'FI'; +update markets set currency = 'EUR' where name = 'GLOBAL'; +update markets set currency = 'EUR' where name = 'DE'; +update markets set currency = 'EUR' where name = 'NL'; +update markets set currency = 'EUR' where name = 'AT'; +update markets set currency = 'USD' where name = 'US'; +update markets set currency = 'EUR' where name = 'ES'; +update markets set currency = 'EUR' where name = 'FR'; +update markets set currency = 'EUR' where name = 'PL'; +update markets set currency = 'EUR' where name = 'IT'; + + +alter table markets + alter column currency set not null;