check-database-compatibility: Ignore guardian, django.contrib.sites.

We can safely ignore the presence of the extra tables that could be
left behind in the database from when we had these installed (before
Zulip 1.7.0 and 2.0.0, respectively).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-02-28 23:50:40 -08:00 committed by Alex Vandiver
parent 1a15d60de4
commit de1fb2b8d0
1 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,14 @@ from django.db.migrations.loader import MigrationLoader
django.setup()
loader = MigrationLoader(connection)
missing = set(loader.applied_migrations)
# Ignore django-guardian, which we installed until 1.7.0~3134
missing.discard(("guardian", "0001_initial"))
# Ignore django.contrib.sites, which we installed until 2.0.0-rc1~984.
missing.discard(("sites", "0001_initial"))
missing.discard(("sites", "0002_alter_domain_unique"))
for key, migration in loader.disk_migrations.items():
missing.discard(key)
missing.difference_update(migration.replaces)