-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
18 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
20 changes: 7 additions & 13 deletions
20
...ded_thumbnail_image_column_to_project_.py → ..._added_social_share_preview_column_to_.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 |
---|---|---|
@@ -1,44 +1,38 @@ | ||
"""Added thumbnail_image column to Project model. | ||
"""Added social_share_preview column to Project model | ||
Revision ID: cfe474af2a94 | ||
Revision ID: 37b764bbddd8 | ||
Revises: 017c60414c03 | ||
Create Date: 2023-10-13 19:54:45.395589 | ||
Create Date: 2023-10-13 20:08:06.483116 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'cfe474af2a94' | ||
revision: str = '37b764bbddd8' | ||
down_revision: str = '017c60414c03' | ||
branch_labels: str | tuple[str, ...] | None = None | ||
depends_on: str | tuple[str, ...] | None = 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 default database.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('project', schema=None) as batch_op: | ||
batch_op.add_column( | ||
sa.Column('thumbnail_image', sa.LargeBinary(), nullable=True) | ||
) | ||
batch_op.add_column(sa.Column('social_share_preview', sa.LargeBinary(), nullable=True)) | ||
|
||
|
||
def downgrade_() -> None: | ||
"""Downgrade default database.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('project', schema=None) as batch_op: | ||
batch_op.drop_column('thumbnail_image') | ||
batch_op.drop_column('social_share_preview') |