Files
database/migrations/archive/000.285.sql
T
Rikard BartholfandGitHub ddcbd0afb0 Archive old migrations (#426)
* Archive old migrations

* Fix invalid placement of migrations
2024-10-17 11:19:12 +02:00

31 lines
1.0 KiB
SQL

-- 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;