Skip to content

Commit 87ab39a

Browse files
committed
- forgot to push the tag
2 parents c40100b + e1fde10 commit 87ab39a

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.2.1
2+
=====
3+
- [bug] Fixed the generation of CHECK constraint,
4+
regression from 0.2.0 [#26]
5+
16
0.2.0
27
=====
38
- [feature] API rearrangement allows everything

alembic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from os import path
22

3-
__version__ = '0.2.0'
3+
__version__ = '0.2.1'
44

55
package_dir = path.abspath(path.dirname(__file__))
66

alembic/autogenerate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def _render_foreign_key(constraint, autogen_context):
454454
),
455455
}
456456

457-
def _render_check_constraint(constraint):
457+
def _render_check_constraint(constraint, autogen_context):
458458
opts = []
459459
if constraint.name:
460460
opts.append(("name", repr(constraint.name)))

tests/test_autogenerate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from sqlalchemy import MetaData, Column, Table, Integer, String, Text, \
2-
Numeric, CHAR, ForeignKey, DATETIME, TypeDecorator
2+
Numeric, CHAR, ForeignKey, DATETIME, TypeDecorator, CheckConstraint
33
from sqlalchemy.types import NULLTYPE
44
from sqlalchemy.engine.reflection import Inspector
55
from alembic import autogenerate
@@ -65,6 +65,7 @@ def _model_two():
6565
Column('id', Integer, primary_key=True),
6666
Column('description', String(100)),
6767
Column('order_id', Integer, ForeignKey('order.order_id')),
68+
CheckConstraint('len(description) > 5')
6869
)
6970
return m
7071

@@ -182,6 +183,7 @@ def test_render_diffs(self):
182183
sa.Column('id', sa.Integer(), nullable=False),
183184
sa.Column('description', sa.String(length=100), nullable=True),
184185
sa.Column('order_id', sa.Integer(), nullable=True),
186+
sa.CheckConstraint('TODO'),
185187
sa.ForeignKeyConstraint(['order_id'], ['order.order_id'], ),
186188
sa.PrimaryKeyConstraint('id')
187189
)

0 commit comments

Comments
 (0)