Bumping version for new feature.

Skipping video epoch test on circleci.

Created script which finds and cleans up (renames/deletes) orphaned video meta files.

Reworking orphaned video query, some video files were leaking through.

Modifying File table to allow finding of orphaned video files.

Extracting epoch from video info_json for more accurate upload_date.

Extracting epoch from video info_json for more accurate upload_date.
This commit is contained in:
Roland 2022-12-06 14:28:35 -07:00
parent b216a9c678
commit d0d69519cd
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
10 changed files with 347 additions and 30 deletions

View file

@ -0,0 +1,43 @@
"""File stem and directory
Revision ID: 6489cd50c889
Revises: 13542a230c78
Create Date: 2022-12-04 15:39:55.485355
"""
import os
from alembic import op
from sqlalchemy.orm import Session
# revision identifiers, used by Alembic.
revision = '6489cd50c889'
down_revision = '13542a230c78'
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)
session.execute('ALTER TABLE file ADD COLUMN directory TEXT')
session.execute('ALTER TABLE file ADD COLUMN full_stem TEXT')
session.execute('ALTER TABLE file ADD COLUMN stem TEXT')
session.execute('CREATE INDEX file_directory_idx ON file(directory)')
session.execute('CREATE INDEX file_full_stem_idx ON file(full_stem)')
session.execute('CREATE INDEX file_stem_idx ON file(stem)')
def downgrade():
bind = op.get_bind()
session = Session(bind=bind)
session.execute('DROP INDEX IF EXISTS file_directory_idx')
session.execute('DROP INDEX IF EXISTS file_full_stem_idx')
session.execute('DROP INDEX IF EXISTS file_stem_idx')
session.execute('ALTER TABLE file DROP COLUMN IF EXISTS directory')
session.execute('ALTER TABLE file DROP COLUMN IF EXISTS full_stem')
session.execute('ALTER TABLE file DROP COLUMN IF EXISTS stem')