-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WCM-614: Add column for video_type so we can query it in auto areas
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...connector/migrations/postdeploy/20250120_1109-239e72a15c2c_create_index_for_video_type.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,40 @@ | ||
"""create index for video_type | ||
Revision ID: 239e72a15c2c | ||
Revises: b6c4f9badee3 | ||
Create Date: 2025-01-20 11:09:46.675290 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '239e72a15c2c' | ||
down_revision: Union[str, None] = 'b6c4f9badee3' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.get_context().autocommit_block(): | ||
op.create_index( | ||
op.f('ix_properties_video_type'), | ||
'properties', | ||
['video_type'], | ||
postgresql_concurrently=True, | ||
if_not_exists=True, | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
with op.get_context().autocommit_block(): | ||
op.drop_index( | ||
op.f('ix_properties_video_type'), | ||
'properties', | ||
['video_type'], | ||
postgresql_concurrently=True, | ||
if_exists=True, | ||
) |
27 changes: 27 additions & 0 deletions
27
...c/zeit/connector/migrations/predeploy/20250120_1106-f7f17b16292c_add_video_type_column.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,27 @@ | ||
"""add video_type column | ||
Revision ID: f7f17b16292c | ||
Revises: 0d681d9ffda0 | ||
Create Date: 2025-01-20 11:06:16.852051 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'f7f17b16292c' | ||
down_revision: Union[str, None] = '0d681d9ffda0' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column('properties', sa.Column('video_type', sa.Unicode(), nullable=True)) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column('properties', 'video_type') |
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