Skip to content

Commit

Permalink
Increase circulationevents.type field length to 50 (from 32) to aacco…
Browse files Browse the repository at this point in the history
…modate new event types.
  • Loading branch information
dbernstein committed Dec 20, 2024
1 parent d614c89 commit 54f9f98
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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)
)
2 changes: 1 addition & 1 deletion src/palace/manager/sqlalchemy/model/circulationevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 54f9f98

Please sign in to comment.