Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert database_reaper to celery (PP-1470) #2324

Merged
merged 11 commits into from
Mar 10, 2025
121 changes: 121 additions & 0 deletions alembic/versions/20250307_61df6012a5e6_update_patron_id_foreign_key.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
"""Update patron_id foreign key

Revision ID: 61df6012a5e6
Revises: 63825d889633
Create Date: 2025-03-07 00:38:25.610733+00:00

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "61df6012a5e6"
down_revision = "63825d889633"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.drop_constraint(
"annotations_patron_id_fkey",
"annotations",
type_="foreignkey",
)
op.create_foreign_key(
"annotations_patron_id_fkey",
"annotations",
"patrons",
["patron_id"],
["id"],
ondelete="CASCADE",
)
op.drop_constraint(
"credentials_patron_id_fkey",
"credentials",
type_="foreignkey",
)
op.create_foreign_key(
"credentials_patron_id_fkey",
"credentials",
"patrons",
["patron_id"],
["id"],
ondelete="CASCADE",
)
op.drop_constraint(
"holds_patron_id_fkey",
"holds",
type_="foreignkey",
)
op.create_foreign_key(
"holds_patron_id_fkey",
"holds",
"patrons",
["patron_id"],
["id"],
ondelete="CASCADE",
)
op.drop_constraint(
"loans_patron_id_fkey",
"loans",
type_="foreignkey",
)
op.create_foreign_key(
"loans_patron_id_fkey",
"loans",
"patrons",
["patron_id"],
["id"],
ondelete="CASCADE",
)


def downgrade() -> None:
op.drop_constraint(
"loans_patron_id_fkey",
"loans",
type_="foreignkey",
)
op.create_foreign_key(
"loans_patron_id_fkey",
"loans",
"patrons",
["patron_id"],
["id"],
)
op.drop_constraint(
"holds_patron_id_fkey",
"holds",
type_="foreignkey",
)
op.create_foreign_key(
"holds_patron_id_fkey",
"holds",
"patrons",
["patron_id"],
["id"],
)
op.drop_constraint(
"credentials_patron_id_fkey",
"credentials",
type_="foreignkey",
)
op.create_foreign_key(
"credentials_patron_id_fkey",
"credentials",
"patrons",
["patron_id"],
["id"],
)
op.drop_constraint(
"annotations_patron_id_fkey",
"annotations",
type_="foreignkey",
)
op.create_foreign_key(
"annotations_patron_id_fkey",
"annotations",
"patrons",
["patron_id"],
["id"],
)
8 changes: 0 additions & 8 deletions bin/database_reaper

This file was deleted.

3 changes: 0 additions & 3 deletions docker/services/cron/cron.d/circulation
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ HOME=/var/www/circulation
# those works.
30 22 * * * root bin/run work_classify_unchecked_subjects >> /var/log/cron.log 2>&1

# Remove miscellaneous expired things from the database
0 2 * * * root bin/run database_reaper >> /var/log/cron.log 2>&1

# Sync a library's collection with NoveList
0 0 * * 0 root bin/run -d 60 novelist_update >> /var/log/cron.log 2>&1

Expand Down
170 changes: 0 additions & 170 deletions src/palace/manager/api/monitor.py

This file was deleted.

Loading