multitenant: prevent repeating migrations and system checks (#46561)
This commit is contained in:
parent
a16f4ce394
commit
e311e2611a
|
@ -80,6 +80,8 @@ class MigrateSchemasCommand(SyncCommon):
|
|||
self._notice("=== Running migrate for schema %s" % schema_name)
|
||||
connection.set_schema(schema_name, include_public=False)
|
||||
command = MigrateCommand()
|
||||
command.requires_system_checks = False
|
||||
command.requires_migrations_checks = False
|
||||
command.execute(*self.args, **self.options)
|
||||
connection.set_schema_to_public()
|
||||
|
||||
|
|
|
@ -96,6 +96,9 @@ class Command(InteractiveTenantOption, BaseCommand):
|
|||
else:
|
||||
klass = load_command_class(app_name, argv[2])
|
||||
|
||||
klass.requires_migrations_checks = False
|
||||
klass.requires_system_checks = False
|
||||
|
||||
# Ugly, but works. Delete tenant_command from the argv, parse the schema manually
|
||||
# and forward the rest of the arguments to the actual command being wrapped.
|
||||
del argv[1]
|
||||
|
|
Loading…
Reference in New Issue