Skip to content

alembic revision --autogenerate #8238

@wardi

Description

@wardi

CKAN version

master

Describe the bug

We can't use alembic revision --autogenerate because our models are out of sync with our migrations. Our models are missing indexes and we have many indexes in migrations that are unnecessary.

Steps to reproduce

Generate an alembic revision with --autogenerate without making any changes to the models, get back 400 lines of:

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_package_tag_continuity_id', table_name='package_tag_revision')
    op.drop_index('idx_package_tag_current', table_name='package_tag_revision')
    op.drop_index('idx_package_tag_revision_id', table_name='package_tag_revision')
    op.drop_index('idx_package_tag_revision_pkg_id', table_name='package_tag_revision')
    op.drop_index('idx_package_tag_revision_pkg_id_tag_id', table_name='package_tag_revision')
…

Expected behavior

Without changes to the models we should get empty upgrade() and downgrade() functions.

Additional details

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions