summaryrefslogtreecommitdiff
path: root/migrate/changeset/databases/postgres.py
diff options
context:
space:
mode:
authorThomas Goirand <thomas@goirand.fr>2014-03-02 14:00:47 +0800
committerSean Dague <sean.dague@samsung.com>2014-03-05 06:55:25 -0500
commitbcb699161546105392ca7b83462a4666130715cd (patch)
tree78965b52b703cfc90cf155a3b8d3f3c67f2e5380 /migrate/changeset/databases/postgres.py
parent0ffaaae93566800495ce23b33123dc392a0e04d8 (diff)
downloadsqlalchemy-migrate-bcb699161546105392ca7b83462a4666130715cd.tar.gz
Fix genmodel for SQLA 0.9
Problem: * Some python code was auto generated and exec'ed in that package. * The python code that was problematic had a 'Table' definition * The generated code imports '*' from sqlalchemy * One among the 'Column' was defined as an 'INTEGER' type, which points to sqlalchemy.sql.sqltypes.INTEGER * The INTEGER class was initialised with a parameter display_width which contradicts with sqlalchemy.sql.sqltypes.INTEGER.__init__, which does not accept any parameters * The 'INTEGER' class should have been imported from mysql dialects' type module Solution: * While generating, in the header part, I am now checking if any of the column.type.__class__.__name__ has 'dialects' in it. * If I find any, I am adding the import rule such that the type is imported from the dialects' type. This patch has been tested with SQLA 0.9.3, for which it fixes the unit tests, and with SQLA 0.8.2, which doesn't have (new) problems with this patch. Change-Id: Ie0e09b45388462629100017bea3ea8a314d148d8
Diffstat (limited to 'migrate/changeset/databases/postgres.py')
0 files changed, 0 insertions, 0 deletions