Naming conventions example should use columns_0_name
The example http://docs.sqlalchemy.org/en/latest/core/constraints.html#configuring-constraint-naming-conventions
convention = {
"ix": 'ix_%(column_0_label)s',
"uq": "uq_%(table_name)s_%(column_0_name)s",
"ck": "ck_%(table_name)s_%(constraint_name)s",
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
"pk": "pk_%(table_name)s"
}
should be changed to "ck": "ck_%(table_name)s_%(column_0_name)s", Otherwise unnamed constraints (for example, Boolean) raise
sqlalchemy.exc.InvalidRequestError: Naming convention including %(constraint_name)s token requires that constraint is explicitly named.
Comments (5)
-
repo owner -
repo owner in fact I'd rather there be additional documentation here for check constraints, as there are different options to go with. the Boolean and Enum objects encourage a constraint name to be passed to their constructors.
-
repo owner - changed milestone to 1.0.xx
-
repo owner - changed milestone to 1.x.xx
-
FWIW I ran into this one as well. I got a pull request for pyramid_sqlalchemy which set a default naming convention (as recommended by the alembic documentation), but after merging that all my tests started failing immediately when trying to use boolean columns on SQLite.
- Log in to comment
you can pullrequest quick ones like these.