Skip to content

Commit

Permalink
Remove patron.last_loan_activity_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Jun 14, 2024
1 parent 1b2ce5f commit e976011
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Remove Patron.last_loan_activity_sync
Revision ID: 7ba553f3f80d
Revises: 50746a3bd243
Create Date: 2024-06-12 00:53:37.497861+00:00
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "7ba553f3f80d"
down_revision = "50746a3bd243"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.drop_column("patrons", "last_loan_activity_sync")


def downgrade() -> None:
op.add_column(
"patrons",
sa.Column(
"last_loan_activity_sync",
postgresql.TIMESTAMP(timezone=True),
autoincrement=False,
nullable=True,
),
)
6 changes: 0 additions & 6 deletions src/palace/manager/sqlalchemy/model/patron.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ class Patron(Base, RedisKeyMixin):
# system such as an ILS.
last_external_sync = Column(DateTime(timezone=True))

# TODO: This field is no longer used. Its left here for backwards compatibility until
# the release with this change is deployed. It should be removed after that.
_REMOVED_last_loan_activity_sync = Column(
"last_loan_activity_sync", DateTime(timezone=True), default=None
)

# The time, if any, at which the user's authorization to borrow
# books expires.
authorization_expires = Column(Date, index=True)
Expand Down

0 comments on commit e976011

Please sign in to comment.