AO3-6726 Separate languages table into work languages and locale languages#5923
Open
pmonfort wants to merge 5 commits into
Open
AO3-6726 Separate languages table into work languages and locale languages#5923pmonfort wants to merge 5 commits into
pmonfort wants to merge 5 commits into
Conversation
pmonfort
force-pushed
the
AO3-6726
branch
2 times, most recently
from
July 8, 2026 02:58
7f7588f to
b692618
Compare
Contributor
Author
|
The failing tests appear to be unrelated to this update, they could be pre-existing flaky tests. Could someone trigger a re-run to make sure? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
AO3-1234 Fix thing)Issue
https://otwarchive.atlassian.net/browse/AO3-6726
Purpose
Separates the
languagestable, currently used for both works and admin/i18n features, into two independent tables:languages— used exclusively for workslocale_languages— used for admin/i18n: locales, admin posts, admin post tags, abuse reports, and support/feedback formsWhat this PR does:
locale_languagestable by cloning the existinglanguagestablATE TABLE ... LIKE+INSERT INTO ... SELECT), preserving IDs so existinglanguage_id` foreign keys work without data migration.Locale,AdminPost, andAdminPostTagtobelongsign_key: :language_id, reusing the existing FK column to avoid data migrations on those tables (per redsummernight's suggestion on related PR. Also removes an orphanedbelongs_to :languagefromArchiveFaq(no FK existed in the table).instead ofLanguage. The abuse report and feedback controllers now queryLocaleLanguage` for available support languages (the models store language as a strlanguagestable but are no longer exposed through the UI or policy.supportandsuperadminroles available totranslation). The work languages index remains public (no authorization on index).rake After:populate_locale_languages_table) to rfromlanguagesif needed after deploy. The migration already copies the data; this task is only needed if the migration data needs to be re-synced.LanguagePolicychanges:create?andupdate?restricted tosupportandsuperadmin(previously also andpolicy_and_abuse)name,short,sortable_name(no more support/LocaleLanguagePolicyroles:index?:translation,support,superadmin,policy_and_abusecreate?:translation,superadminupdate?:translation,superadmin,support,policy_and_abuse(with role-ses:supportcan only editsupport_available,policy_and_abusecan only editabuse_support_available)Testing Instructions
Testing instructions are in the Jira issue.
References
Credit
Pablo Monfort (he/him)