-
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-285: add new columns channel and subchannels
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
WCM-285: add new columns channel and subchannels |
44 changes: 44 additions & 0 deletions
44
...migrations/postdeploy/20240912_1058-6cc99f5afdc5_add_channels_and_subchannels_columns_.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,44 @@ | ||
"""add channels and subchannels columns index | ||
Revision ID: 6cc99f5afdc5 | ||
Revises: cf24009572b7 | ||
Create Date: 2024-09-12 10:58:00.181930 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '6cc99f5afdc5' | ||
down_revision: Union[str, None] = 'cf24009572b7' | ||
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( | ||
'ix_properties_channels', | ||
'properties', | ||
['channels'], | ||
unique=False, | ||
postgresql_using='gin', | ||
postgresql_concurrently=True, | ||
if_not_exists=True, | ||
) | ||
op.create_index( | ||
'ix_properties_subchannels', | ||
'properties', | ||
['subchannels'], | ||
unique=False, | ||
postgresql_using='gin', | ||
postgresql_concurrently=True, | ||
if_not_exists=True, | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_index('ix_properties_subchannels', table_name='properties', postgresql_using='gin') | ||
op.drop_index('ix_properties_channels', table_name='properties', postgresql_using='gin') |
28 changes: 28 additions & 0 deletions
28
...r/migrations/predeploy/20240912_1056-9aba9394d011_add_channels_and_subchannels_columns.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,28 @@ | ||
"""add channels and subchannels columns | ||
Revision ID: 9aba9394d011 | ||
Revises: 5f2720a9a131 | ||
Create Date: 2024-09-12 10:56:52.266201 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '9aba9394d011' | ||
down_revision: Union[str, None] = '5f2720a9a131' | ||
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('channels', sa.ARRAY(sa.Unicode()), nullable=True)) | ||
op.add_column('properties', sa.Column('subchannels', sa.ARRAY(sa.Unicode()), nullable=True)) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column('properties', 'subchannels') | ||
op.drop_column('properties', 'channels') |
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