Skip to content

Draft: Check return values for select statements#249

Open
felix-bedag wants to merge 2 commits intodevelopfrom
feature/more-resilient-migration
Open

Draft: Check return values for select statements#249
felix-bedag wants to merge 2 commits intodevelopfrom
feature/more-resilient-migration

Conversation

@felix-bedag
Copy link
Contributor

If the select statements don't find anything with the strict keyword the function call fails. If this happens on a trigger, this means that all inserts on ab_permission_view fail if they don't concern DAGs.

With this change also other permission_views can be inserted.

Even though this change will not be applied where the migration already ran, it will be applied for new deployments, which is where the error appeared consistently

If they don't find anything with the strict keyword the function call fails.
If this happens on a trigger, this means that all inserts on ab_permission_view
fail if they don't concern DAGs.

With this change also other permission_views can be inserted.

Even though this change will not be applied where the migration already ran,
it will be applied for new deployments, which is where the error appeared consistently
@felix-bedag
Copy link
Contributor Author

@wieczorslawo I inserted this change directly into the preexisting migration, as the one following it fails without. I wonder how it ever managed to run through... Do you have an idea?

Since editing the preexisting migration doesn't really fix the other instances, do you think it would be good to insert a new migration recreating the trigger with the newest version too? I think that would be nice actually...

@wieczorslawo
Copy link
Contributor

Hi @felix-bedag
If you want to overwrite the trigger, you have to add another file. Something like 05_update_triggers.sql and reference it in the airflow-changelog.xml file. Otherwise, the migration will fail during the checksum validation on every environment we deploy this version to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants