-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #927 from openedx/cag/tags
feat: add tag related tables
- Loading branch information
Showing
6 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
tutoraspects/patches/openedx-dev-dockerfile-post-python-requirements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ | ||
pip install "platform-plugin-aspects==v0.10.0" | ||
pip install "platform-plugin-aspects==v0.11.0" | ||
|
||
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ | ||
pip install "edx-event-routing-backends>=9.3.0,<9.4" |
2 changes: 1 addition & 1 deletion
2
tutoraspects/patches/openedx-dockerfile-post-python-requirements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ | ||
pip install "platform-plugin-aspects==v0.10.0" | ||
pip install "platform-plugin-aspects==v0.11.0" | ||
|
||
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ | ||
pip install "edx-event-routing-backends>=9.3.0,<9.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
...emplates/aspects/apps/aspects/migrations/alembic/versions/0039_event_sink_tag_taxonomy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
revision = "0039" | ||
down_revision = "0038" | ||
branch_labels = None | ||
depends_on = None | ||
on_cluster = " ON CLUSTER '{{CLICKHOUSE_CLUSTER_NAME}}' " if "{{CLICKHOUSE_CLUSTER_NAME}}" else "" | ||
engine = ( | ||
"ReplicatedReplacingMergeTree" | ||
if "{{CLICKHOUSE_CLUSTER_NAME}}" | ||
else "ReplacingMergeTree" | ||
) | ||
|
||
|
||
def upgrade(): | ||
op.execute( | ||
f""" | ||
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.tag | ||
{on_cluster} | ||
( | ||
id Int32, | ||
taxonomy Int32, | ||
parent Int32, | ||
value String, | ||
external_id String, | ||
lineage String, | ||
dump_id UUID NOT NULL, | ||
time_last_dumped String NOT NULL | ||
) ENGINE {engine} | ||
ORDER BY (id, time_last_dumped) | ||
PRIMARY KEY (id, time_last_dumped); | ||
""" | ||
) | ||
|
||
op.execute( | ||
f""" | ||
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.taxonomy | ||
{on_cluster} | ||
( | ||
id Int32, | ||
name String, | ||
dump_id UUID NOT NULL, | ||
time_last_dumped String NOT NULL | ||
) ENGINE {engine} | ||
ORDER BY (id, time_last_dumped) | ||
PRIMARY KEY (id, time_last_dumped); | ||
""" | ||
) | ||
|
||
|
||
op.execute( | ||
f""" | ||
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.object_tag | ||
{on_cluster} | ||
( | ||
id Int32, | ||
object_id String, | ||
taxonomy Int32, | ||
tag Int32, | ||
_value String, | ||
_export_id String, | ||
lineage String, | ||
dump_id UUID NOT NULL, | ||
time_last_dumped String NOT NULL | ||
) ENGINE {engine} | ||
ORDER BY (id, time_last_dumped) | ||
PRIMARY KEY (id, time_last_dumped); | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
"DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.tag" | ||
f"{on_cluster};" | ||
) | ||
|
||
op.execute( | ||
"DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.taxonomy" | ||
f"{on_cluster};" | ||
) | ||
|
||
op.execute( | ||
"DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.object_tag" | ||
f"{on_cluster};" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters