Skip to content

Commit

Permalink
Add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Aug 31, 2023
1 parent 7479e9f commit 662ad2b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Remove self_hosted from licensepools
Revision ID: 1c566151741f
Revises: 0df58829fc1a
Create Date: 2023-08-31 16:13:54.935093+00:00
"""
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "1c566151741f"
down_revision = "0df58829fc1a"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.drop_index("ix_licensepools_self_hosted", table_name="licensepools")
op.drop_column("licensepools", "self_hosted")


def downgrade() -> None:
op.add_column(
"licensepools",
sa.Column("self_hosted", sa.BOOLEAN(), autoincrement=False, nullable=False),
)
op.create_index(
"ix_licensepools_self_hosted", "licensepools", ["self_hosted"], unique=False
)
3 changes: 0 additions & 3 deletions core/model/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@ class LicensePool(Base):
licenses_reserved = Column(Integer, default=0)
patrons_in_hold_queue = Column(Integer, default=0)

# Set to True for collections imported using MirrorUploaded
self_hosted = Column(Boolean, index=True, nullable=False, default=False)

# This lets us cache the work of figuring out the best open access
# link for this LicensePool.
_open_access_download_url = Column("open_access_download_url", Unicode)
Expand Down

0 comments on commit 662ad2b

Please sign in to comment.