Skip to content

Commit

Permalink
remove added migration file and make it work in one file
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimbuddy committed Nov 29, 2024
1 parent 5a8a920 commit 59b3fd5
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def upgrade():
columns=["dag_id"],
unique=False,
)

with op.batch_alter_table("dag_schedule_asset_alias_reference", schema=None) as batch_op:
batch_op.create_foreign_key(
constraint_name="dsaar_asset_alias_fkey",
referent_table="asset_alias",
Expand Down Expand Up @@ -284,7 +284,8 @@ def upgrade():
columns=["dag_id"],
unique=False,
)

with op.batch_alter_table("task_outlet_asset_reference", schema=None) as batch_op:
batch_op.create_foreign_key("toar_asset_fkey", "asset", ["asset_id"], ["id"], ondelete="CASCADE")
batch_op.create_foreign_key(
constraint_name="toar_dag_id_fkey",
referent_table="dag",
Expand Down Expand Up @@ -313,7 +314,8 @@ def upgrade():
columns=["target_dag_id"],
unique=False,
)

with op.batch_alter_table("asset_dag_run_queue", schema=None) as batch_op:
batch_op.create_foreign_key("adrq_asset_fkey", "asset", ["asset_id"], ["id"], ondelete="CASCADE")
batch_op.create_foreign_key(
constraint_name="adrq_dag_fkey",
referent_table="dag",
Expand Down Expand Up @@ -550,7 +552,7 @@ def downgrade():

with op.batch_alter_table("task_outlet_dataset_reference", schema=None) as batch_op:
batch_op.alter_column("asset_id", new_column_name="dataset_id", type_=sa.Integer(), nullable=False)

batch_op.drop_constraint("toar_asset_fkey", type_="foreignkey")
batch_op.drop_constraint("toar_dag_id_fkey", type_="foreignkey")

_rename_index(
Expand Down Expand Up @@ -585,6 +587,7 @@ def downgrade():
with op.batch_alter_table("dataset_dag_run_queue", schema=None) as batch_op:
batch_op.alter_column("asset_id", new_column_name="dataset_id", type_=sa.Integer(), nullable=False)

batch_op.drop_constraint("adrq_asset_fkey", type_="foreignkey")
batch_op.drop_constraint("adrq_dag_fkey", type_="foreignkey")

_rename_pk_constraint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Add UUID primary key to ``task_instance`` table.
Revision ID: d59cbbef95eb
Revises: c4a1639f0f67
Revises: 05234396c6fc
Create Date: 2024-10-21 22:39:12.394079
"""

Expand All @@ -33,7 +33,7 @@

# revision identifiers, used by Alembic.
revision = "d59cbbef95eb"
down_revision = "c4a1639f0f67"
down_revision = "05234396c6fc"
branch_labels = "None"
depends_on = None
airflow_version = "3.0.0"
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apache-airflow/img/airflow_erd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4b6f0aec7b0cb8a2e78a5483b69d38f396102693095623d901163f0aa32e8dfd
b42b04b6cc47650cb9e7a37258a6e8e99bdca2677253715505b8ad287192bf72
4 changes: 1 addition & 3 deletions docs/apache-airflow/migrations-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ Here's the list of all the Database Migrations that are executed via when you ru
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``486ac7936b78`` | ``d59cbbef95eb`` | ``3.0.0`` | remove scheduler_lock column. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``d59cbbef95eb`` | ``c4a1639f0f67`` | ``3.0.0`` | Add UUID primary key to ``task_instance`` table. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``c4a1639f0f67`` | ``05234396c6fc`` | ``3.0.0`` | create foreign key constraints for assets. |
| ``d59cbbef95eb`` | ``05234396c6fc`` | ``3.0.0`` | Add UUID primary key to ``task_instance`` table. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``05234396c6fc`` | ``3a8972ecb8f9`` | ``3.0.0`` | Rename dataset as asset. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
Expand Down

0 comments on commit 59b3fd5

Please sign in to comment.