mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
This moves it "earlier" in the migrations graph, onto the last migration in 9.x, and adds a merge migration to fold it back into main's current migrations tip.
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
# Generated by Django 5.0.9 on 2024-12-10 15:49
|
|
|
|
from django.db import migrations
|
|
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
|
from django.db.migrations.state import StateApps
|
|
|
|
|
|
def update_zh_hant_tw_language(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
|
|
UserProfile = apps.get_model("zerver", "UserProfile")
|
|
UserProfile.objects.filter(default_language="zh-hant").update(default_language="zh-tw")
|
|
|
|
PreregistrationRealm = apps.get_model("zerver", "PreregistrationRealm")
|
|
PreregistrationRealm.objects.filter(default_language="zh-hant").update(default_language="zh-tw")
|
|
|
|
Realm = apps.get_model("zerver", "Realm")
|
|
Realm.objects.filter(default_language="zh-hant").update(default_language="zh-tw")
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
# The most recent 9.x migration, since this will be backported
|
|
("zerver", "0622_backfill_imageattachment_again"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(
|
|
update_zh_hant_tw_language,
|
|
elidable=True,
|
|
reverse_code=migrations.RunPython.noop,
|
|
)
|
|
]
|