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

Abierto
#6,342 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
20/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
django, python
Área
backend, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
212
Forks
321
Merge medio
1 d 7 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de learningequality/studio

Todos los issues de learningequality/studio

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.