imsweb / django-history-triggers

Django management command and middleware for creating and maintaining PostgreSQL audit trail triggers.
BSD 2-Clause "Simplified" License
3 stars 7 forks source link

Dropping triggers respects "HISTORY_IGNORED_TABLES" setting #2

Closed lefcourn closed 6 years ago

lefcourn commented 6 years ago

Came across an instance where I wanted to remove the triggers for a specific table, but the "--drop" function respects the "HISTORY_IGNORED_TABLES" value too (so the triggers were NOT removed). Should this be the case?

The work around is to drop the triggers before updating the code and then building them after. This doesn't seem like a great solution.

dcwatson commented 6 years ago

If I'm understanding correctly, the history table was generated because the table wasn't originally ignored, then you wanted to drop the triggers and add it to the ignored list going forward?

If that's the case, I don't think there's much we should do. If dropping didn't respect that setting, you may end up with a situation where the app drops tables/triggers you put on manually, which would be far worse than you having to drop them manually.

lefcourn commented 6 years ago

Yeah, that is exactly the situation I was describing. I see your point and I don't think it's worth the effort building in a solution for this. We might want to make a note of it though.