Skip to content

Commit

Permalink
Increase block id size
Browse files Browse the repository at this point in the history
Related to issue #632
  • Loading branch information
hardbyte committed Mar 22, 2021
1 parent 7835abf commit b9e4624
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Increase size of block id from 64 chars to 512
Revision ID: 23aa8b3ed0a4
Revises: e321799791b7
Create Date: 2021-03-22 14:52:29.067646
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '23aa8b3ed0a4'
down_revision = 'e321799791b7'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('blocks', 'block_name',
existing_type=sa.CHAR(length=64),
type_=sa.CHAR(length=512),
existing_nullable=False)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('blocks', 'block_name',
existing_type=sa.CHAR(length=512),
type_=sa.CHAR(length=64),
existing_nullable=False)
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion backend/entityservice/database/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Block(Base):
)

dp = Column(ForeignKey('dataproviders.id', ondelete='CASCADE'))
block_name = Column(CHAR(64), nullable=False)
block_name = Column(CHAR(512), nullable=False)
block_id = Column(Integer, primary_key=True)
count = Column(Integer, nullable=False)
state = Column(Enum(BlockState, name='processedstate'), nullable=False)
Expand Down

0 comments on commit b9e4624

Please sign in to comment.