mirror of
https://git.0x0.st/mia/0x0.git
synced 2025-07-04 15:00:21 +02:00
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:
parent
afb5811879
commit
6d036eeb7d
5 changed files with 215 additions and 52 deletions
22
migrations/versions/939a08e1d6e5_.py
Normal file
22
migrations/versions/939a08e1d6e5_.py
Normal 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')
|
Loading…
Add table
Add a link
Reference in a new issue