ALTER TABLE bonus_stores
    DROP CONSTRAINT fk_bonsto_on_bonus;

ALTER TABLE bonus_stores
    DROP CONSTRAINT fk_bonsto_on_store;

ALTER TABLE store_bonuses
    DROP CONSTRAINT fk_stobon_on_bonus;

ALTER TABLE district
    ADD store_id BIGINT;

ALTER TABLE store_bonuses
    ADD CONSTRAINT uc_store_bonuses_bonuses UNIQUE (bonuses_id);

ALTER TABLE district
    ADD CONSTRAINT FK_DISTRICT_ON_STORE FOREIGN KEY (store_id) REFERENCES store (id);

ALTER TABLE store_bonuses
    ADD CONSTRAINT fk_stobon_on_bonus_date FOREIGN KEY (bonuses_id) REFERENCES bonus_date (id);