mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-25 18:40:06 -04:00
Parsing SingleFile datetime using dates.strpdate. Adding timezone when no timezone info is available. Installing python-dateutil to assist in handling diverse datetime strings. Reworking refresh progress to use idempotency to display more accurate progress. Only logging that files have been invalidated if they used to be indexed. Clearing archives to force re-index. Ignoring 'Unknown' author from PDF metadata. Using file_title when pdf metadata title is empty.
32 lines
712 B
Python
32 lines
712 B
Python
"""Reindex archives.
|
|
|
|
Revision ID: 4b54ad052e2e
|
|
Revises: 6b0b249a4f81
|
|
Create Date: 2023-10-20 13:28:55.517086
|
|
|
|
"""
|
|
import os
|
|
|
|
from alembic import op
|
|
from sqlalchemy.orm import Session
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '4b54ad052e2e'
|
|
down_revision = '6b0b249a4f81'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
|
|
|
|
|
|
def upgrade():
|
|
bind = op.get_bind()
|
|
session = Session(bind=bind)
|
|
|
|
# Archives must be re-indexed because of the previous revision.
|
|
session.execute("UPDATE file_group SET indexed=false WHERE model='archive'")
|
|
session.execute("DELETE FROM archive") # noqa
|
|
|
|
|
|
def downgrade():
|
|
pass
|