Closed YaraslauZhylko closed 1 year ago
Thanks for the report! The Function/Trigger implementations are under utilized in comparison to some of the other features, so much appreciated (particularly for easy to fix things like this!)
Fix should be released in v0.6.6 in a few minutes
@DanCardin The release seems to work fine. No errors raised, no false-positive migrations generated.
Thanks for the prompt fix!
Trigger definition without
.when()
function call:Produced migration command:
The migration command is correct and is successfully applied to the PostgreSQL DB.
But when I try to generate a new migration, the reflection of the previously created trigger fails:
The code fails here: https://github.com/DanCardin/sqlalchemy-declarative-extensions/blob/6b6e7abc2efbd97e9ec5ddd77027fea4d5f3b146/src/sqlalchemy_declarative_extensions/dialects/postgresql/query.py#L195
Because it unconditionally expects a
WHEN
condition and tries to process it as a string. But the condition does not exist and is set toNone
.