fixed type comparison for Decimal with scale but without precision
Ivan Melnychuk
Branch: ivan.melnychuk/alembic:master
Branch: zzzeek/alembic:master
Declined
Declined pull request
Dear contributor - This pull request is being moved to Gerrit, at https://gerrit.sqlalchemy.org/488, where it may be tested and reviewed more closely. As such, the pull request itself is being marked "closed" or "declined", however your contribution is merely being moved to our central review system. Please register at https://gerrit.sqlalchemy.org#/register/ to send and receive comments regarding this item.
Closed by: Mike Bayer·2017-08-25
If the user were to specify the
Numeric(scale=N)
without any precision, sqlalchemy would generate not specialised NUMERIC data type for a DDL (@see: https://bitbucket.org/zzzeek/sqlalchemy/src/63d47c051d92ffa78f1006d9c9f83f1508bc358e/lib/sqlalchemy/sql/compiler.py?at=master&fileviewer=file-view-default#compiler.py-2734)However, this would always result in a type check detection on alembic, although this type change will not be applied.
It probably is a big mistake for the user to specify
scale
without theprecision
. However, for consistency reasons this fix should be applied. Alternatively, a warning in the above linkedvisit_NUMERIC
function should be generated for such case.