Change single-quoting of floats in PostgreSQL compare_server_default
Dimitris Theodorou
Branch: dtheodor/alembic:master
Branch: zzzeek/alembic:master
Merged
Merged pull request
Merge https://bitbucket.org/dtheodor/alembic/branch/master into pr37
Merge https://bitbucket.org/dtheodor/alembic/branch/master into pr37
This is a fix for https://bitbucket.org/zzzeek/alembic/issue/241.
It avoids the query causing an error
SELECT 5 = '5.0'
, which is a result of a database default ofDEFAULT 5
paired with a python default ofserver_default="5.0"
.I remove the wrapping of a default string value with single-quotes if the compared column is floating-point or numeric, so the above now is always
SELECT 5 = 5.0
.I also added a couple of Postgres tests with floats, trying out the various misconfigurations of server defaults.