typing: Use BaseDatabaseSchemaEditor in place of DatabaseSchemaEditor.

This is a part of #18777.

Signed-off-by: Zixuan James Li <359101898@qq.com>
This commit is contained in:
Zixuan James Li
2022-05-27 17:33:51 -04:00
committed by Tim Abbott
parent 63e9ae8389
commit d5517932cd
101 changed files with 260 additions and 224 deletions

View File

@@ -1,7 +1,7 @@
import unicodedata
from django.db import connection, migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
# There are 66 Unicode non-characters; see
@@ -18,7 +18,7 @@ def character_is_printable(character: str) -> bool:
return not (unicodedata.category(character) in ["Cc", "Cs"] or character in unicode_non_chars)
def fix_topics(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
def fix_topics(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
Message = apps.get_model("zerver", "Message")
BATCH_SIZE = 10000
messages_updated = 0