-- P5-6131 Splashes belong to market_locale

ALTER TABLE slideshow_slides ADD COLUMN market_locale_id INTEGER REFERENCES market_locales (id);

UPDATE slideshow_slides SET market_locale_id = (
    select id from market_locales
    where slideshow_slides.market_id = market_locales.market_id
    order by market_locales.id limit 1
);

ALTER TABLE slideshow_slides ALTER COLUMN market_locale_id SET NOT NULL;
