Skip to content

Commit

Permalink
Fix migrations (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
haneslinger authored Jun 16, 2023
1 parent 0aaf03c commit 7e446a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def upgrade():
# add NULLABLE 'id' column
with op.batch_alter_table("deps_association_table", schema=None) as batch_op:
batch_op.add_column(sa.Column("id", sa.Integer(), nullable=True))
batch_op.drop_constraint("deps_association_table_pkey", type_="primary")
batch_op.drop_constraint("pk_constraint", type_="primary")
batch_op.create_primary_key("deps_association_pk", columns=["id"])
batch_op.alter_column(
existing_type=sa.INTEGER(),
Expand Down
4 changes: 3 additions & 1 deletion migrations/versions/5cacb139c494_add_manifest_to_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("models", schema=None) as batch_op:
batch_op.add_column(sa.Column("manifest_id", sa.Integer(), nullable=True))
batch_op.create_foreign_key(None, "shape_collection", ["manifest_id"], ["id"])
batch_op.create_foreign_key(
"fk_shape_collection", "shape_collection", ["manifest_id"], ["id"]
)

conn = op.get_bind()
Session = sessionmaker()
Expand Down
2 changes: 1 addition & 1 deletion migrations/versions/ee47e252795d_init_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def upgrade():
["dependee_id"],
["template.id"],
),
sa.PrimaryKeyConstraint("dependant_id", "dependee_id"),
sa.PrimaryKeyConstraint("dependant_id", "dependee_id", name="pk_constraint"),
)
# ### end Alembic commands ###

Expand Down

0 comments on commit 7e446a9

Please sign in to comment.