diff --git a/alembic/versions/20230831_1c566151741f_remove_self_hosted_from_licensepools.py b/alembic/versions/20230831_1c566151741f_remove_self_hosted_from_licensepools.py new file mode 100644 index 0000000000..0290e717e2 --- /dev/null +++ b/alembic/versions/20230831_1c566151741f_remove_self_hosted_from_licensepools.py @@ -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 + ) diff --git a/core/model/licensing.py b/core/model/licensing.py index 6ef35eaaff..788fe095af 100644 --- a/core/model/licensing.py +++ b/core/model/licensing.py @@ -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)