Mark migrations as ignored
This commit is contained in:
1 parent
357f0aebf4
commit
9e3dbf7778
22 files changed
+310
-12
No files matched your search
@@ -24,6 +24,11 @@ from .sql_analyser import analyse_sql_statements
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Can be used to mark ignored migrations.
|
||||
# This is a noop for SQL. Comments would be better.
|
||||
# But comments are stripped by RunSQL
|
||||
IGNORE_MIGRATION = "SELECT 'dml-ignore'"
|
||||
|
||||
|
||||
class MigrationLinter(object):
|
||||
MIGRATION_FOLDER_NAME = 'migrations'
|
||||
@@ -69,6 +74,12 @@ class MigrationLinter(object):
|
||||
analysis_result = analyse_sql_statements(
|
||||
sql_statements)
|
||||
errors = analysis_result['errors']
|
||||
|
||||
if analysis_result['ignored']:
|
||||
print('IGNORE')
|
||||
self.nb_ignored += 1
|
||||
return
|
||||
|
||||
if not errors:
|
||||
print('OK')
|
||||
self.nb_valid += 1
|
||||
|
||||
Reference in new issue
Block a user