Skip to content

Commit

Permalink
[qa] fix migration
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Jun 4, 2024
1 parent 838acc0 commit b901f5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions zou/migrations/versions/1bb55759146f_add_table_studio.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Add table Studio
Revision ID: 1bb55759146f
Revises: 680c64565f9d
Revises: be56dc0fb760
Create Date: 2024-05-31 15:30:17.189541
"""
Expand All @@ -14,7 +14,7 @@

# revision identifiers, used by Alembic.
revision = "1bb55759146f"
down_revision = "680c64565f9d"
down_revision = "be56dc0fb760"
branch_labels = None
depends_on = None

Expand Down Expand Up @@ -49,15 +49,17 @@ def upgrade():
batch_op.create_index(
batch_op.f("ix_person_studio_id"), ["studio_id"], unique=False
)
batch_op.create_foreign_key(None, "studio", ["studio_id"], ["id"])
batch_op.create_foreign_key(
"person_studio_id_fkey", "studio", ["studio_id"], ["id"]
)

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("person", schema=None) as batch_op:
batch_op.drop_constraint(None, type_="foreignkey")
batch_op.drop_constraint("person_studio_id_fkey", type_="foreignkey")
batch_op.drop_index(batch_op.f("ix_person_studio_id"))
batch_op.drop_column("studio_id")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# revision identifiers, used by Alembic.
revision = "9b85c14fa8a7"
down_revision = "16328eae4b5f"
down_revision = "45dafbb3f4e1"
branch_labels = None
depends_on = None

Expand Down

0 comments on commit b901f5d

Please sign in to comment.