Skip to content

Commit

Permalink
feat: Upgrade event-sink-clickhouse to 1.0.0
Browse files Browse the repository at this point in the history
Adds email to the user_profile table.
  • Loading branch information
bmtcril committed Jan 30, 2024
1 parent 478fe07 commit 81b2f8b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
(
"OPENEDX_EXTRA_PIP_REQUIREMENTS",
[
"openedx-event-sink-clickhouse==0.5.0",
"openedx-event-sink-clickhouse==1.0.0",
"edx-event-routing-backends==v7.2.0",
],
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
Add email column to user profile table
"""
from alembic import op


revision = "0031"
down_revision = "0030"
branch_labels = None
depends_on = None
on_cluster = " ON CLUSTER '{{CLICKHOUSE_CLUSTER_NAME}}' " if "{{CLICKHOUSE_CLUSTER_NAME}}" else ""


def upgrade():
op.execute(
f"""
ALTER TABLE {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_USER_PROFILE_TABLE }}
{on_cluster}
ADD COLUMN IF NOT EXISTS email String DEFAULT ''
AFTER name;
"""
)


def downgrade():
op.execute(
f"""
ALTER TABLE {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_USER_PROFILE_TABLE }}
{on_cluster}
DROP COLUMN IF EXISTS email;
"""
)

0 comments on commit 81b2f8b

Please sign in to comment.