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-6212 AO3-6573 Add indices to tag_set_associations, and add the departure gem to make future migrations easier. #4528

Conversation

tickinginstant
Copy link
Contributor

@tickinginstant tickinginstant commented Jun 10, 2023

Issue

https://otwarchive.atlassian.net/browse/AO3-6212
https://otwarchive.atlassian.net/browse/AO3-6573

Purpose

  • Adds the departure gem, so that we can simplify the code for migrations on large tables.
  • Moves the PTOSC arguments into the config file, so that it's easier to customize them for different systems.
  • Adds three indices to the tag_set_associations table:
    • One on the tag ID.
    • One on the parent tag ID.
    • One on the owned tag set ID, the parent tag ID, and the tag ID. This one is unique.

A couple notes:

  • I removed the --no-drop-old-table flag, since that may not be necessary now that the databases are on MariaDB. Because the flags are now controlled through the config files (and can be overridden by specifying the PERCONA_ARGS environment variable), it shouldn't require a PR to add back the flag if MariaDB turns out to have similar problems to MySQL.
  • I think this is a good migration to test things with, including departure. It's on a relatively large table, so it probably should use PTOSC, but if something goes catastrophically wrong, it should only affect a relatively small number of users.

Testing Instructions

As on Jira, but since this introduces a new tool, there'll need to be some systems changes prior to the deploys on staging and production.

Also introduces the departure gem, to make future migrations easier.
@github-actions github-actions bot added Gem Updates Has Migrations Contains migrations and therefore needs special attention when deploying Awaiting Review labels Jun 10, 2023
@sarken
Copy link
Collaborator

sarken commented Jun 21, 2023

(james indicated he wanted to look at this when he had time, so I'm tagging him in as an assignee.)

@sarken sarken changed the title AO3-6212 Add indices to tag_set_associations, and add the departure gem to make future migrations easier. AO3-6212 AO3-6573 Add indices to tag_set_associations, and add the departure gem to make future migrations easier. Aug 1, 2023
ceithir added a commit to ceithir/otwarchive that referenced this pull request Aug 8, 2023
@sarken sarken merged commit 6504b0b into otwcode:master Aug 13, 2023
sarken pushed a commit that referenced this pull request Aug 28, 2023
* Adding

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

* Remove

* Replace many ifelse with case

* Display logs on admin page

* Forgot to log admin identity

* Also show logs on the FNOK side

* Test for display

Keeping it simple by not checking id for now

* Add Alterity

* Forgot to commit previously

* Hound

* Hound (bis)

* Hound (ter)

* Add i18n keys to exceptions

* Remove Alterity actually

Superseded by #4528

* Add pt-online-schema-change syntax for prod

* Remove explicit foreign key

Similar migrations don't appear to set one

* Implicit NULL default value

* Test id too

* Add user destroy controller test

Apparently didn't exist before?

* Log automatic removal of fnok on deletion

* Hound

* Use classical I18n syntax

* Simplify fnok name action

* Clean other I18n keys

* Hound

* reviewdog

* Normalize i18n

* Syntax more compliant with i18n-tasks

* Wordings

* Explicit over succinct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gem Updates Has Migrations Contains migrations and therefore needs special attention when deploying Reviewed: Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants