diff --git a/alembic/versions/20241220_579786fecbf4_increase_circulation_event_type_field_.py b/alembic/versions/20241220_579786fecbf4_increase_circulation_event_type_field_.py new file mode 100644 index 000000000..0bd334bad --- /dev/null +++ b/alembic/versions/20241220_579786fecbf4_increase_circulation_event_type_field_.py @@ -0,0 +1,28 @@ +"""Increase circulation event type field length + +Revision ID: 579786fecbf4 +Revises: 603b8ebd6daf +Create Date: 2024-12-20 06:30:30.148748+00:00 + +""" + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "579786fecbf4" +down_revision = "603b8ebd6daf" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.alter_column( + "circulationevents", "type", existing_type=sa.VARCHAR(32), type_=sa.VARCHAR(50) + ) + + +def downgrade() -> None: + op.alter_column( + "circulationevents", "type", existing_type=sa.VARCHAR(50), type_=sa.VARCHAR(32) + ) diff --git a/src/palace/manager/sqlalchemy/model/circulationevent.py b/src/palace/manager/sqlalchemy/model/circulationevent.py index c2c1c33f9..8de41658d 100644 --- a/src/palace/manager/sqlalchemy/model/circulationevent.py +++ b/src/palace/manager/sqlalchemy/model/circulationevent.py @@ -35,7 +35,7 @@ class CirculationEvent(Base): "LicensePool", back_populates="circulation_events" ) - type = Column(String(32), index=True) + type = Column(String(50), index=True) start = Column(DateTime(timezone=True), index=True) end = Column(DateTime(timezone=True)) old_value = Column(Integer)