Skip to content

Commit

Permalink
Merge pull request #132 from bento-platform/fix/drop-bundle-migration
Browse files Browse the repository at this point in the history
fix: try to fix object bundle_id drop migration
  • Loading branch information
davidlougheed authored Oct 1, 2024
2 parents 83c053d + dd92068 commit 71e4cf8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion chord_drs/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

# Attach the database to the application and run migrations if needed
db.init_app(application)
migrate = Migrate(application, db, directory=MIGRATION_DIR)
migrate = Migrate(application, db, directory=MIGRATION_DIR, render_as_batch=True)

# Register routes
application.register_blueprint(drs_service)
Expand Down
2 changes: 0 additions & 2 deletions chord_drs/migrations/versions/5e982af5cde4_remove_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###

with op.batch_alter_table("drs_object", schema=None) as batch_op:
batch_op.drop_constraint(None, type_="foreignkey")
batch_op.drop_column("bundle_id")

op.drop_table("drs_bundle")
Expand Down Expand Up @@ -54,6 +53,5 @@ def downgrade():

with op.batch_alter_table("drs_object", schema=None) as batch_op:
batch_op.add_column(sa.Column("bundle_id", sa.INTEGER(), nullable=True))
batch_op.create_foreign_key(None, "drs_bundle", ["bundle_id"], ["id"])

# ### end Alembic commands ###

0 comments on commit 71e4cf8

Please sign in to comment.