Change single-quoting of floats in PostgreSQL compare_server_default

Merged
#37 · Created  · Last updated

Merged pull request

Merge https://bitbucket.org/dtheodor/alembic/branch/master into pr37

b2fb21f·Author: ·Closed by: ·2015-01-12

Description

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 of DEFAULT 5 paired with a python default of server_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.

0 attachments

0 comments

Loading commits...