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.
was about to say, this should really be stated as text("0.0"); when you put "0.0" directly that means the default is the string value "0.0". the docs for server_default state that it will be quoted as a string otherwise.
as far as the exception here, not sure. one idea is to catch the exception and emit as a warning, since this can be fixed on the user end. or to do the cast. let's see how the cast works can you send me a PR ?
Yeah, so this example (from real-life code) is bogus (both DEFAULT 0 and server_default="0.0" are misconfigurations), however it is valid Postgres. This PR tries to avoid the alembic autogenerate crash, and in particular it decides to consider the 2 values equal.
Since postgres comparisons use db queries, right now they are kind of unique in that they may crash, leaving you with a failed autogenerate with a stack trace. Is this acceptable or should alembic do some catching of exceptions with some logic whether to consider the comparison as failed and/or logging towards the user?