From 1e6562474f8e827b95da5952ebd36947b178aa61 Mon Sep 17 00:00:00 2001 From: anishTP Date: Fri, 13 Oct 2023 19:58:11 +0530 Subject: [PATCH] removed LargeBinary import --- funnel/models/project.py | 3 +-- ...94_added_thumbnail_image_column_to_project_.py} | 14 ++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) rename migrations/versions/{ce340b5b9d1e_added_thumbnail_image_column_to_project_.py => cfe474af2a94_added_thumbnail_image_column_to_project_.py} (80%) diff --git a/funnel/models/project.py b/funnel/models/project.py index ae7256f74..5dd3f1929 100644 --- a/funnel/models/project.py +++ b/funnel/models/project.py @@ -5,7 +5,6 @@ from collections.abc import Sequence from pytz import utc -from sqlalchemy import LargeBinary from sqlalchemy.orm import attribute_keyed_dict from werkzeug.utils import cached_property @@ -194,7 +193,7 @@ class Project(UuidMixin, BaseScopedNameMixin, Model): ) thumbnail_image = with_roles( - sa.orm.mapped_column(LargeBinary, nullable=True), + sa.orm.mapped_column(sa.LargeBinary, nullable=True), read={'all'}, datasets={'primary', 'without_parent', 'related'}, ) diff --git a/migrations/versions/ce340b5b9d1e_added_thumbnail_image_column_to_project_.py b/migrations/versions/cfe474af2a94_added_thumbnail_image_column_to_project_.py similarity index 80% rename from migrations/versions/ce340b5b9d1e_added_thumbnail_image_column_to_project_.py rename to migrations/versions/cfe474af2a94_added_thumbnail_image_column_to_project_.py index 33732310a..b77493090 100644 --- a/migrations/versions/ce340b5b9d1e_added_thumbnail_image_column_to_project_.py +++ b/migrations/versions/cfe474af2a94_added_thumbnail_image_column_to_project_.py @@ -1,16 +1,16 @@ -"""Added thumbnail_image column to Project model +"""Added thumbnail_image column to Project model. -Revision ID: ce340b5b9d1e +Revision ID: cfe474af2a94 Revises: 017c60414c03 -Create Date: 2023-10-13 19:38:30.010804 +Create Date: 2023-10-13 19:54:45.395589 """ -import sqlalchemy as sa from alembic import op +import sqlalchemy as sa # revision identifiers, used by Alembic. -revision: str = 'ce340b5b9d1e' +revision: str = 'cfe474af2a94' down_revision: str = '017c60414c03' branch_labels: str | tuple[str, ...] | None = None depends_on: str | tuple[str, ...] | None = None @@ -32,9 +32,7 @@ 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('thumbnail_image', sa.LargeBinary(), nullable=True)) def downgrade_() -> None: