# Path: django_migration_linter/sql_analyser/utils.py
# def update_migration_tests(base_tests, specific_tests):
#     base_tests = deepcopy(base_tests)
#     for override_test in specific_tests:
#         migration_test_dict = find_error_dict_with_code(
#             base_tests, override_test["code"]
#         )
# 
#         if migration_test_dict is None or not override_test["code"]:
#             migration_test_dict = {}
#             base_tests.append(migration_test_dict)
# 
#         for key in override_test.keys():
#             migration_test_dict[key] = override_test[key]
#     return base_tests


import logging
import re
from .utils import update_migration_tests
        {
            "code": "NOT_NULL",
            "fn": has_not_null_column,
            "msg": "NOT NULL constraint on columns",
            "mode": "transaction",
            "type": "error",
        },
        {
            "code": "DROP_COLUMN",
            "fn": lambda sql, **kw: re.search("DROP COLUMN", sql),
            "msg": "DROPPING columns",
            "mode": "one_liner",
            "type": "error",
        },
        {
            "code": "DROP_TABLE",
            "fn": lambda sql, **kw: sql.startswith("DROP TABLE"),
            "msg": "DROPPING table",
            "mode": "one_liner",
            "type": "error",
        },
        {
            "code": "RENAME_COLUMN",
            "fn": lambda sql, **kw: re.search("ALTER TABLE .* CHANGE", sql)
            or re.search("ALTER TABLE .* RENAME COLUMN", sql),
            "msg": "RENAMING columns",
            "mode": "one_liner",
            "type": "error",
        },
        {

# Path: django_migration_linter/sql_analyser/utils.py
# def update_migration_tests(base_tests, specific_tests):
#     base_tests = deepcopy(base_tests)
#     for override_test in specific_tests:
#         migration_test_dict = find_error_dict_with_code(
#             base_tests, override_test["code"]
#         )
# 
#         if migration_test_dict is None or not override_test["code"]:
#             migration_test_dict = {}
#             base_tests.append(migration_test_dict)
# 
#         for key in override_test.keys():
#             migration_test_dict[key] = override_test[key]
#     return base_tests


# Path: django_migration_linter/sql_analyser/base.py
import logging
import re
from .utils import update_migration_tests

        {
            "code": "NOT_NULL",
            "fn": has_not_null_column,
            "msg": "NOT NULL constraint on columns",
            "mode": "transaction",
            "type": "error",
        },
        {
            "code": "DROP_COLUMN",
            "fn": lambda sql, **kw: re.search("DROP COLUMN", sql),
            "msg": "DROPPING columns",
            "mode": "one_liner",
            "type": "error",
        },
        {
            "code": "DROP_TABLE",
            "fn": lambda sql, **kw: sql.startswith("DROP TABLE"),
            "msg": "DROPPING table",
            "mode": "one_liner",
            "type": "error",
        },
        {
            "code": "RENAME_COLUMN",
            "fn": lambda sql, **kw: re.search("ALTER TABLE .* CHANGE", sql)
            or re.search("ALTER TABLE .* RENAME COLUMN", sql),
            "msg": "RENAMING columns",
            "mode": "one_liner",
            "type": "error",
        },
        {

            "code": "ALTER_COLUMN",