P5-6514 use market_locale_id for redirects (#173)
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
-- P5-6514: use market_locale_id for redirects
|
||||||
|
|
||||||
|
alter table redirects
|
||||||
|
add column market_locale_id integer;
|
||||||
|
|
||||||
|
|
||||||
|
alter table redirects
|
||||||
|
add constraint market_locale_id_fkey
|
||||||
|
foreign key (market_locale_id)
|
||||||
|
references market_locales(id) match simple;
|
||||||
|
|
||||||
|
|
||||||
|
update redirects set market_locale_id = (
|
||||||
|
select id from market_locales where market_id = redirects.market_id
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
alter table redirects
|
||||||
|
alter column market_locale_id set not null;
|
||||||
|
|
||||||
|
|
||||||
|
alter table redirects
|
||||||
|
drop column market_id;
|
||||||
Reference in New Issue
Block a user