Skip to content

Commit

Permalink
fix: new migration
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed Feb 6, 2025
1 parent cae6f60 commit 6b45099
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ def downgrade():
"DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_blocks"
f"{on_cluster}"
)
op.execute(
"DROP DICTIONARY IF EXISTS {{ DBT_PROFILE_TARGET_DATABASE }}.dim_most_recent_course_tags"
f"{on_cluster}"
)
op.execute(
"DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.dim_course_names"
f"{on_cluster}"
)
op.execute(
"DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_overviews"
f"{on_cluster}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from alembic import op
import clickhouse_sqlalchemy
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '0041'
down_revision = '0040'
branch_labels = None
depends_on = None
on_cluster = " ON CLUSTER '{{CLICKHOUSE_CLUSTER_NAME}}' " if "{{CLICKHOUSE_CLUSTER_NAME}}" else ""
engine = "ReplicatedMergeTree" if "{{CLICKHOUSE_CLUSTER_NAME}}" else "MergeTree"



def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###


def downgrade():
op.execute(
"DROP DICTIONARY IF EXISTS {{ DBT_PROFILE_TARGET_DATABASE }}.dim_most_recent_course_tags"
f"{on_cluster}"
)
op.execute(
"DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.dim_course_names"
f"{on_cluster}"
)

0 comments on commit 6b45099

Please sign in to comment.