[QTI] Make unstable's migration graph match the migrations applied in production

オープン
#6,342 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
django, python
領域
backend, database

調査の方向性

The issue identifies the migration graph and the relevant migrations: 0168_alter_assessmentitem_type, 0169_invitation_organization, and the leaf migrations named in the acceptance criteria. Read those migration files and Django’s migration documentation, then check the production and unstable histories described here. Done means both histories migrate successfully and makemigrations --check reports no changes; the issue says it is not open for contribution.

索引モデルが issue の本文から書いたものです。

説明

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

As unstable stands today, the QTI release will fail to deploy at migrate, so unstable's migration graph needs to match what production has applied.

  • Production has applied 0168_alter_assessmentitem_type on top of 0167_file_size_bigint_expand.
  • Unstable's copy of 0168 depends on 0167_add_organization, which production has never applied.
  • Django refuses to migrate a database where an applied migration has an unapplied dependency, and raises InconsistentMigrationHistory.

Part of #6337. Starts after the hotfixes → unstable merge that brings in 0169_file_size_bigint_swap, so it can be tested against production's full history. Must be in unstable before the QTI release is cut.

Complexity: Low
Target branch: unstable

Context
  • master / hotfixes: 0166 → 0167_file_size_bigint_expand → 0168_alter_assessmentitem_type → 0169_file_size_bigint_swap.
  • unstable: 0166 → 0167_add_organization → 0168_alter_assessmentitem_type → 0169_invitation_organization.
  • On unstable, 0170_merge_20260717_0136 merges 0167_file_size_bigint_expand with 0169_invitation_organization.
  • 0169_file_size_bigint_swap also depends on 0168, and reaches unstable with the next hotfixes → unstable merge.
  • That merge leaves two leaf migrations, so the merge PR must add a merge migration: Django refuses to migrate without one, and CI's makemigrations --check fails.
  • The conflict is in unstable today. The hotfixes → unstable merge doesn't cause it, and doesn't fix it.
The Change
  • Point unstable's 0168 back to 0167_file_size_bigint_expand, as in production.
  • Make 0169_invitation_organization also depend on 0167_add_organization. It adds a foreign key to Organization, and once 0168 stops depending on 0167_add_organization, nothing else makes that table exist first.
Decisions
  • Why change unstable's migrations, and not production's django_migrations table? It keeps the deploy free of manual steps.
Known gaps
  • Local databases last migrated on unstable before 0170_merge_20260717_0136 have unstable's 0168 applied without 0167_file_size_bigint_expand, so they raise InconsistentMigrationHistory after this change. Migrating them before pulling it, or resetting them, fixes that.
Acceptance Criteria
  • migrate succeeds on a database with production's history (0167_file_size_bigint_expand, 0168_alter_assessmentitem_type and 0169_file_size_bigint_swap applied)
  • migrate still succeeds on a database that is already on unstable's history through 0170_merge_20260717_0136
  • makemigrations --check reports no changes

AI usage

Claude found this while comparing the migrations on master, hotfixes and unstable, and drafted the issue, which I then checked and corrected for accuracy.

主要言語
Python
スター
212
フォーク
321
平均マージ
1日 7時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

learningequality/studio のほかの issue

learningequality/studio の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。