Add support for expiring files

SUPPLEMENTALLY:
- Add an `expiration` field to the `file` table of the database
- Produce a migration for the above change
- Overhaul the cleanup script, and integrate into fhost.py
  (now run using FLASK_APP=fhost flask prune)
- Replace the old cleanup script with a deprecation notice
- Add information about how to expire files to the index
- Update the README with information about the new script
This commit is contained in:
Emi Simpson 2022-11-22 16:15:50 -05:00
parent afb5811879
commit 6d036eeb7d
No known key found for this signature in database
GPG key ID: A12F2C2FFDC3D847
5 changed files with 215 additions and 52 deletions

View file

@ -0,0 +1,22 @@
"""add file expirations [creates legacy files]
Revision ID: 939a08e1d6e5
Revises: 7e246705da6a
Create Date: 2022-11-22 12:16:32.517184
"""
# revision identifiers, used by Alembic.
revision = '939a08e1d6e5'
down_revision = '7e246705da6a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('file', sa.Column('expiration', sa.BigInteger()))
def downgrade():
op.drop_column('file', 'expiration')