From 521b6381b0d7946103ef2ce44d08d7923ad28e48 Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Wed, 27 Nov 2024 17:32:56 +0100 Subject: [PATCH] fix migration imports --- .../migrations/versions/163f616930fb_migration_for_.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/data_handler/migrations/versions/163f616930fb_migration_for_.py b/apps/data_handler/migrations/versions/163f616930fb_migration_for_.py index 77bc0da4..3f6ee90b 100644 --- a/apps/data_handler/migrations/versions/163f616930fb_migration_for_.py +++ b/apps/data_handler/migrations/versions/163f616930fb_migration_for_.py @@ -9,6 +9,8 @@ from alembic import op import sqlalchemy as sa +import sqlalchemy_utils +from shared.constants import ProtocolIDs # revision identifiers, used by Alembic. @@ -25,7 +27,7 @@ def upgrade() -> None: sa.Column('amount', sa.Numeric(precision=38, scale=18), nullable=False), sa.Column('event_name', sa.String(), nullable=False), sa.Column('block_number', sa.Integer(), nullable=False), - sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(), nullable=False), + sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(ProtocolIDs, impl=sa.String()), nullable=False), sa.Column('id', sa.UUID(), nullable=False), sa.PrimaryKeyConstraint('id') ) @@ -36,7 +38,7 @@ def upgrade() -> None: sa.Column('amount', sa.Numeric(precision=38, scale=18), nullable=False), sa.Column('event_name', sa.String(), nullable=False), sa.Column('block_number', sa.Integer(), nullable=False), - sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(), nullable=False), + sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(ProtocolIDs, impl=sa.String()), nullable=False), sa.Column('id', sa.UUID(), nullable=False), sa.PrimaryKeyConstraint('id') ) @@ -47,7 +49,7 @@ def upgrade() -> None: sa.Column('amount', sa.Numeric(precision=38, scale=18), nullable=False), sa.Column('event_name', sa.String(), nullable=False), sa.Column('block_number', sa.Integer(), nullable=False), - sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(), nullable=False), + sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(ProtocolIDs, impl=sa.String()), nullable=False), sa.Column('id', sa.UUID(), nullable=False), sa.PrimaryKeyConstraint('id') ) @@ -59,7 +61,7 @@ def upgrade() -> None: sa.Column('amount', sa.Numeric(precision=38, scale=18), nullable=False), sa.Column('event_name', sa.String(), nullable=False), sa.Column('block_number', sa.Integer(), nullable=False), - sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(), nullable=False), + sa.Column('protocol_id', sqlalchemy_utils.types.choice.ChoiceType(ProtocolIDs, impl=sa.String()), nullable=False), sa.Column('id', sa.UUID(), nullable=False), sa.PrimaryKeyConstraint('id') )