-
-
Notifications
You must be signed in to change notification settings - Fork 321
Closed
Labels
Description
Given the following revision script:
from alembic import op
import sqlalchemy as sa
revision = "bug_demo"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table("foo", sa.Column("col1", sa.Integer, sa.CheckConstraint("col1>0")))
op.add_column("foo", sa.Column("col2", sa.Integer, sa.CheckConstraint("col2>0")))
def downgrade():
passThe command alembic upgrade --sql bug_demo produces:
...
CREATE TABLE foo (
col1 INTEGER CHECK (col1>0)
);
ALTER TABLE foo ADD COLUMN col2 INTEGER;
...col1 has the check constraint applied, but col2 does not.
Reactions are currently unavailable