mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
36 lines
765 B
Python
36 lines
765 B
Python
"""Doc indexer.
|
|
|
|
Revision ID: 1c041aeee0fc
|
|
Revises: d96a04eb2785
|
|
Create Date: 2024-03-05 16:54:34.478974
|
|
|
|
"""
|
|
import os
|
|
|
|
from alembic import op
|
|
from sqlalchemy.orm import Session
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '1c041aeee0fc'
|
|
down_revision = 'd96a04eb2785'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
|
|
|
|
|
|
def upgrade():
|
|
# Re-index Word documents.
|
|
bind = op.get_bind()
|
|
session = Session(bind=bind)
|
|
session.execute(
|
|
"""
|
|
UPDATE file_group
|
|
SET indexed=false
|
|
WHERE mimetype in
|
|
('application/msword','application/vnd.openxmlformats-officedocument.wordprocessingml.document')
|
|
""")
|
|
|
|
|
|
def downgrade():
|
|
pass
|