Skip to content

Commit

Permalink
Refactor v65 migration script to remove dropping of FK indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
maallen committed Jan 19, 2024
1 parent b4523d9 commit fb43911
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
ALTER TABLE pull_run_text_unit_variant
DROP FOREIGN KEY FK__PULL_RUN_TEXT_UNIT_VARIANT__PULL_RUN_ASSET_ID;

ALTER TABLE pull_run_text_unit_variant
DROP FOREIGN KEY FK__PULL_RUN_TEXT_UNIT_VARIANT__TM_TEXT_UNIT_VARIANT_ID;

ALTER TABLE pull_run_text_unit_variant
DROP FOREIGN KEY FK__PULL_RUN_TEXT_UNIT_VARIANT__LOCALE__ID;

ALTER TABLE pull_run_text_unit_variant DROP INDEX UK__PULL_RUN_TEXT_UNIT_VARIANT__LOCALE_ID__PRA_ID__TUV_ID;

ALTER TABLE pull_run_text_unit_variant
ADD CONSTRAINT FK__PULL_RUN_TEXT_UNIT_VARIANT__PULL_RUN_ASSET_ID FOREIGN KEY (pull_run_asset_id) REFERENCES pull_run_asset (id);

ALTER TABLE pull_run_text_unit_variant
ADD CONSTRAINT FK__PULL_RUN_TEXT_UNIT_VARIANT__TM_TEXT_UNIT_VARIANT_ID FOREIGN KEY (tm_text_unit_variant_id) REFERENCES tm_text_unit_variant (id);

ALTER TABLE pull_run_text_unit_variant ADD COLUMN output_bcp47_tag VARCHAR(20);

ALTER TABLE pull_run_text_unit_variant ADD CONSTRAINT UK__PULL_RUN_TEXT_UNIT_VARIANT__LOCALE_ID__PRA_ID__TUV_ID__TAG UNIQUE (pull_run_asset_id, locale_id, tm_text_unit_variant_id, output_bcp47_tag);
alter table pull_run_text_unit_variant add constraint FK__PULL_RUN_TEXT_UNIT_VARIANT__LOCALE__ID foreign key (locale_id) references locale (id);
ALTER TABLE pull_run_text_unit_variant DROP INDEX UK__PULL_RUN_TEXT_UNIT_VARIANT__LOCALE_ID__PRA_ID__TUV_ID;

0 comments on commit fb43911

Please sign in to comment.