Repository navigation
fix(backend): legacy退避テーブルを削除しmigrationの主キー衝突を解消 - #92
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
このPRによるapi.jsonの差分 |
Contributor
🖥 Frontend Diagnostics Report(No significant changes) Requests by resource type
V8 heap snapshot statistics
📦 Bundle StatsChunk size diff (0 updated, 0 added, 0 removed)
Startup chunk size (0 updated, 0 added, 0 removed)
Startup chunks are the Vite entry for
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
⚙️ Backend Diagnostics ReportMemory: After GC(No significant changes) V8 Heap Snapshot Statistics
|
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.
What
TypeAny移行で退避したlegacyテーブル4種類を、通常のmigration実行で削除します。
legacy_emoji_requestlegacy_note_schedulelegacy_note_unreadlegacy_inbox_rule主キー衝突を解消する修復migrationを、
AlignSchema1791103688453の直前に追加します。通常migrationの最後には
DropLegacyTablesで4種類を削除します。pnpm migrate・Docker起動スクリプト・既存migrationは変更しません。専用DataSourceと先行実行コマンドは不要です。
Why
旧形式の
emoji_requestを退避しても、主キーインデックス名PK_3c74521e048dc744f0c7eb65f4aが残り、AlignSchemaの主キー作成が42P07で停止します。未使用のタイムスタンプ
1791103688452に修復migrationを追加し、既存の1791103688453の直前で名前を解放します。既存履歴の書き換えや実行処理の特別扱いは行いません。
すでにAlignSchemaを適用したDBでも、TypeORMが未実行の修復migrationを認識することを確認しています。
本番の稼働中15 DBを読み取り専用で確認し、legacyは4種類・54テーブルでした。
現行コードからの利用と外部キー参照はありませんでした。
旧未読記録だけは5 DBに合計14行あり、これも削除対象に含みます。
その他のlegacyはすべて0行でした。
legacy全体の削除はユーザーの依頼に基づきます。
Additional info (optional)
pnpm --filter backend migrateが成功。両方ともlegacyテーブル0件・check-migrationsのpending DDL 0件。node --test packages/backend/test/migration/legacy-cleanup.test.mjs。CASCADEとワイルドカード削除は使いません。対象4種類を明示し、外部参照があれば停止します。down()は復元できると誤認させず、明示的にエラーにします。Checklist