Skip to content

Check Constraint support in MariaDB #479

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by MartinH (@dwt)

I just found out that MariaDB since version 10.2 supports check constraints

https://mariadb.com/kb/en/library/mariadb-1021-release-notes/
https://mariadb.com/kb/en/constraint/

yet when I try to drop one via alembic, I get this error

  File "/Users/dwt/.virtualenvs/yeepa/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 340, in _mysql_drop_constraint
    "No generic 'DROP CONSTRAINT' in MySQL - "
NotImplementedError: No generic 'DROP CONSTRAINT' in MySQL - please specify constraint type

if I don't specify the constraint type 'check'. But if I do, I get this

  File "/Users/dwt/.virtualenvs/yeepa/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 337, in _mysql_drop_constraint
    "MySQL does not support CHECK constraints.")
NotImplementedError: MySQL does not support CHECK constraints.

This is on alembic (0.9.7) - which I believe is the latest released version.

Is there kind of a flag I can set to work around this? Of course I also have production databases which don't yet support this flag...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions