-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flag for participant-only video (#1851)
- Loading branch information
Showing
2 changed files
with
67 additions
and
9 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
52 changes: 52 additions & 0 deletions
52
migrations/versions/d5b374c9e589_add_flag_for_participant_only_.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,52 @@ | ||
"""Add flag for participant-only livestreams. | ||
Revision ID: d5b374c9e589 | ||
Revises: ee418ce7d057 | ||
Create Date: 2023-08-10 19:56:09.419445 | ||
""" | ||
|
||
from typing import Optional, Tuple, Union | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'd5b374c9e589' | ||
down_revision: str = 'ee418ce7d057' | ||
branch_labels: Optional[Union[str, Tuple[str, ...]]] = None | ||
depends_on: Optional[Union[str, Tuple[str, ...]]] = None | ||
|
||
|
||
def upgrade(engine_name: str = '') -> None: | ||
"""Upgrade all databases.""" | ||
# Do not modify. Edit `upgrade_` instead | ||
globals().get(f'upgrade_{engine_name}', lambda: None)() | ||
|
||
|
||
def downgrade(engine_name: str = '') -> None: | ||
"""Downgrade all databases.""" | ||
# Do not modify. Edit `downgrade_` instead | ||
globals().get(f'downgrade_{engine_name}', lambda: None)() | ||
|
||
|
||
def upgrade_() -> None: | ||
"""Upgrade database bind ''.""" | ||
with op.batch_alter_table('project', schema=None) as batch_op: | ||
batch_op.add_column( | ||
sa.Column( | ||
'is_restricted_video', | ||
sa.Boolean(), | ||
nullable=True, | ||
server_default=sa.false(), | ||
) | ||
) | ||
batch_op.alter_column( | ||
'is_restricted_video', nullable=False, server_default=None | ||
) | ||
|
||
|
||
def downgrade_() -> None: | ||
"""Downgrade database bind ''.""" | ||
with op.batch_alter_table('project', schema=None) as batch_op: | ||
batch_op.drop_column('is_restricted_video') |