From dcaa52a4da9f61cfa72df403376ac6dd52107a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kr=C3=B6nke?= Date: Thu, 16 May 2019 18:00:40 +0200 Subject: [PATCH] simplify IgnoreMigration operation --- django_migration_linter/operations.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/django_migration_linter/operations.py b/django_migration_linter/operations.py index e8e4bf1..cb4f767 100644 --- a/django_migration_linter/operations.py +++ b/django_migration_linter/operations.py @@ -14,23 +14,20 @@ from django.db.migrations.operations.base import Operation -IGNORE_MIGRATION_SQL = "select 1; -- dml ignores this migration" - class IgnoreMigration(Operation): reversible = True - # Must be true to be generated through the sqlmigrate command - reduces_to_sql = True + reduces_to_sql = False def state_forwards(self, app_label, state): pass def database_forwards(self, app_label, schema_editor, from_state, to_state): - schema_editor.execute(IGNORE_MIGRATION_SQL) + pass def database_backwards(self, app_label, schema_editor, from_state, to_state): - schema_editor.execute(IGNORE_MIGRATION_SQL + " (reversed)") + pass def describe(self): return "The Django migration linter will ignore this migration"