-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add username to user_profile serializer
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
.../templates/aspects/apps/aspects/migrations/alembic/versions/0040_user_profile_username.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,35 @@ | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
revision = "0040" | ||
down_revision = "0039" | ||
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""" | ||
ALTER TABLE {{ ASPECTS_EVENT_SINK_DATABASE }}.user_profile | ||
{on_cluster} | ||
ADD COLUMN IF NOT EXISTS username String DEFAULT '' | ||
AFTER name; | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
f""" | ||
ALTER TABLE {{ ASPECTS_EVENT_SINK_DATABASE }}.user_profile | ||
{on_cluster} | ||
DROP COLUMN IF EXISTS username; | ||
""" | ||
) |