Skip to content

support CHECK constraints for autogenerate #508

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Alex Rothberg

If I start with the following and then uncomment the CheckConstraint, alembic does not handle the migration adding it or even print a warning. If I just have alembic add the entire class the migration to add the class DOES have the CheckConstraint.

class TitleDepartmentYear(db.Model):
    id = db.Column(UUID, default=uuid.uuid4, primary_key=True)
    name = db.Column(db.String(), nullable=False)

    __table_args__ = (
#        db.CheckConstraint(
#           sqa.func.char_length(name) > 0,
#          name="title_department_year_name_min_length",
#      ),
    )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions