Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 4.2.30 on 2026-08-25 15:23

from django.db import migrations


class Migration(migrations.Migration):
"""Widen the username_list join table id from int to bigint.

The table dates from 2019, before DEFAULT_AUTO_FIELD became
BigAutoField. Django takes the primary key of an auto-created
many-to-many through model from that setting, so a new database
builds this column as bigint while production keeps the int column
it got in 2019. Migration 0008 widened the concrete models only.

makemigrations cannot find this difference, because both sides of
the comparison come from the same setting. For the same reason the
model state is already a BigAutoField, so this needs no
state_operations: it only makes the production schema agree.

The statement is idempotent, and makes no change to a database that
is already bigint. The reverse is a no-op, because a real reverse
fails or truncates when an id is more than 2**31.

Bug: T434707
"""

dependencies = [
("organisations", "0009_organisation_username_list_updated"),
]

operations = [
migrations.RunSQL(
# Keep AUTO_INCREMENT here. MODIFY replaces the full column
# definition, so the sequence goes away if you remove it.
sql="ALTER TABLE organisations_organisation_username_list "
"MODIFY id BIGINT NOT NULL AUTO_INCREMENT",
reverse_sql=migrations.RunSQL.noop,
),
]
Loading