Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
anishTP committed Oct 13, 2023
1 parent 0e86504 commit dac8b79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
6 changes: 1 addition & 5 deletions funnel/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,7 @@ class Project(UuidMixin, BaseScopedNameMixin, Model):
datasets={'primary', 'without_parent', 'related'},
)

thumbnail_image = with_roles(
sa.orm.mapped_column(sa.LargeBinary, nullable=True),
read={'all'},
datasets={'primary', 'without_parent', 'related'},
)
social_share_preview: Mapped[bytes | None] = sa.orm.mapped_column(sa.LargeBinary, nullable=True, deferred=True)

allow_rsvp: Mapped[bool] = with_roles(
sa.orm.mapped_column(sa.Boolean, default=True, nullable=False),
Expand Down
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')

0 comments on commit dac8b79

Please sign in to comment.