1"""Remove Artifact foreign keys
2
3Revision ID: cfdfec5d7557
4Revises: 2a88656f4a23
5Create Date: 2023-02-08 15:19:58.751027
6
7"""
8
9from alembic import op
10
11# revision identifiers, used by Alembic.
12revision = "cfdfec5d7557"
13down_revision = "2a88656f4a23"
14branch_labels = None
15depends_on = None
16
17
18def upgrade():
19 op.drop_constraint(
20 "fk_artifact__task_run_id__task_run", "artifact", type_="foreignkey"
21 )
22 op.drop_constraint(
23 "fk_artifact__flow_run_id__flow_run", "artifact", type_="foreignkey"
24 )
25
26
27def downgrade():
28 op.create_foreign_key(
29 "fk_artifact__flow_run_id__flow_run",
30 "artifact",
31 "flow_run",
32 ["flow_run_id"],
33 ["id"],
34 )
35 op.create_foreign_key(
36 "fk_artifact__task_run_id__task_run",
37 "artifact",
38 "task_run",
39 ["task_run_id"],
40 ["id"],
41 )