Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AO3-5697 Add unique index to meta_taggings table. #3585

Merged

Conversation

tickinginstant
Copy link
Contributor

Issue

https://otwarchive.atlassian.net/browse/AO3-5697

Purpose

This PR replaces the index on meta_tag_id for the meta_taggings table with a unique index on (meta_tag_id, sub_tag_id).

For pt-online-schema-change, I believe the argument to --alter corresponding to this migration is:

  ADD UNIQUE INDEX
    index_meta_taggings_on_meta_tag_id_and_sub_tag_id
    (meta_tag_id, sub_tag_id),
  DROP INDEX
    index_meta_taggings_on_meta_tag_id

The argument --nocheck-unique-key-change may also be necessary, since pt-online-schema-change tries to ensure that data will not be lost when adding a new unique index.

For pt-online-schema-change, the argument to --alter corresponding to
this migration is:

  ADD UNIQUE INDEX
    index_meta_taggings_on_meta_tag_id_and_sub_tag_id
    (meta_tag_id, sub_tag_id),
  DROP INDEX
    index_meta_taggings_on_meta_tag_id

The argument --nocheck-unique-key-change may also be necessary, since
pt-online-schema-change tries to ensure that data will not be lost when
adding a new unique index.
@redsummernight redsummernight added the Has Migrations Contains migrations and therefore needs special attention when deploying label Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Has Migrations Contains migrations and therefore needs special attention when deploying Reviewed: Ready to Merge
Projects
None yet
3 participants