From 3843e91f8af81ccf1ed35e5537ad2d0813a8e80d Mon Sep 17 00:00:00 2001 From: Martin Carlsson Date: Wed, 28 Oct 2020 14:01:11 +0100 Subject: [PATCH] P5-6098 add markets_locales table --- migrations/000.252.sql | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 migrations/000.252.sql diff --git a/migrations/000.252.sql b/migrations/000.252.sql new file mode 100644 index 0000000..dce6a15 --- /dev/null +++ b/migrations/000.252.sql @@ -0,0 +1,26 @@ +-- P5-6098: add market_locales table + +drop table if exists market_locales; + + +create table market_locales ( + id serial, + market_id integer not null, + locale_id integer not null +); + + +alter table market_locales + add constraint market_fkey + foreign key (market_id) + references markets(id) match simple; + + +alter table market_locales + add constraint locale_fkey + foreign key (locale_id) + references locales(id) match simple; + + +insert into market_locales (market_id, locale_id) + select id, locale_id from markets;