1. Michael Bayer
  2. alembic
  3. Issues

Issues

Issue #42 resolved

Error with Enum and autogenerate

Marc Schlaich
created an issue

Having a column with an Enum generates the following line on autogenerate which fails on the upgrade command

{{{

!python

sa.CheckConstraint('TODO') }}}

Comments (3)

  1. Michael Bayer repo owner

    assuming this is the Enum that's in the model, not in the database. detecting CHECK constraints from the database is not implemented and it will never be possible to detect an ENUM from a database that doesn't natively support enums.

    Also note that autogenerate never guarantees that the migration can be run without first modifying the autogenerated migrations.

  2. Michael Bayer repo owner

    CheckConstraint rendering was implemented some time ago, and also a straight Enum doesn't seem to be generating the separate constraint either right now, I think that was fixed also.

  3. Log in to comment