[GRDM-62502] E2E Testにおける20250906からのアップグレード試験でmigrationが失敗する問題を修正 - #780
Draft
yacchin1205 wants to merge 1 commit into
Draft
[GRDM-62502] E2E Testにおける20250906からのアップグレード試験でmigrationが失敗する問題を修正#780yacchin1205 wants to merge 1 commit into
yacchin1205 wants to merge 1 commit into
Conversation
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.
Purpose
E2E Test における 20250906 からのアップグレード試験で、
osf.0267_split_name_fieldsの適用中にdjango.db.utils.ProgrammingError: column osf_osfuser.ial does not existで失敗し、アップグレードが完了しません。#777 のialプロパティ追加前に 267, 270 の migration を適用していれば、本問題は発生しません。0267 は data migration の中で現行モデルの
FileMetadata.save()を呼んでおり、その save() が検索インデックスの更新を誘発してFileMetadata.creator(現行のOSFUserモデル)を参照します。migration の途中ではosf_osfuserは 0267 時点のスキーマのままなので、それ以降に追加された列(今回は #777 のial)を参照した時点で落ちます。このため 0267 より後に
osf_osfuserへ列を追加するたびに、過去バージョンからのアップグレードが遡って壊れます。FileMetadataのレコードが存在する環境でのみ発生し、レコードが無い新規構築では発生しません。同じ実装を使うosf.0270_remove_metadata_access_rightsも同様です。Changes
FileMetadataMigratorが historical model(apps.get_model)で対象を取得・保存するように変更(0267 / 0270 からappsを引き渡し)QA Notes
Documentation
None
Side Effects
None
Ticket
GRDM-62502