Skip to content

Commit 355c657

Browse files
committed
alembic ignore add check constraint
1 parent 398d6d7 commit 355c657

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sqlalchemy_iris/alembic.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from sqlalchemy.ext.compiler import compiles
88
from sqlalchemy.sql.base import Executable
99
from sqlalchemy.sql.elements import ClauseElement
10+
from sqlalchemy.sql.schema import CheckConstraint
1011
from sqlalchemy.sql.type_api import TypeEngine
1112
from sqlalchemy.sql import table
1213
from sqlalchemy import types
@@ -134,6 +135,12 @@ def alter_column(
134135
**kw,
135136
)
136137

138+
def add_constraint(self, const: Any) -> None:
139+
if isinstance(const, CheckConstraint):
140+
# just ignore it
141+
return
142+
super().add_constraint(const)
143+
137144

138145
class _ExecDropForeignKey(Executable, ClauseElement):
139146
inherit_cache = False

0 commit comments

Comments
 (0)