You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this tool to lint my Postgres migrations (definitely prevented several headaches on deploy) and I found a false-positive:
BEGIN;
-- Create trigger api_user_update on model userCREATE OR REPLACEFUNCTION "public"._pgtrigger_should_ignore(
trigger_name NAME
)
RETURNS BOOLEANAS $$
DECLARE
_pgtrigger_ignore TEXT[];
BEGIN
IF _pgtrigger_ignore IS NOT NULL THEN
SELECT trigger_name = ANY(_pgtrigger_ignore)
-- And so onCOMMIT;
Some of my hand-written migrations also get flagged for this reason.
If I also may, I suggest that the .startswith() checks should be .strip().lower().startswith() to deal with possible future regressions because of indented/hand-written migrations
The text was updated successfully, but these errors were encountered:
Hello.
I am using this tool to lint my Postgres migrations (definitely prevented several headaches on deploy) and I found a false-positive:
The migration/sql is courtesy of django-pgtrigger.
This gets flagged because of the if statement, which I think should not trip up the detection. It gets flagged here:
django-migration-linter/django_migration_linter/sql_analyser/base.py
Line 43 in 3503367
Some of my hand-written migrations also get flagged for this reason.
If I also may, I suggest that the
.startswith()
checks should be.strip().lower().startswith()
to deal with possible future regressions because of indented/hand-written migrationsThe text was updated successfully, but these errors were encountered: