mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-22 16:06:19 -05:00
33 lines
839 B
Python
33 lines
839 B
Python
"""Video censored
|
|
|
|
Revision ID: 32d96eb9122d
|
|
Revises: 184329ed5137
|
|
Create Date: 2021-12-23 14:03:53.677547
|
|
|
|
"""
|
|
import os
|
|
|
|
from alembic import op
|
|
from sqlalchemy.orm import Session
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '32d96eb9122d'
|
|
down_revision = '184329ed5137'
|
|
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 video ADD COLUMN censored BOOL DEFAULT false')
|
|
session.execute('CREATE INDEX video_censored ON video (censored)')
|
|
|
|
|
|
def downgrade():
|
|
bind = op.get_bind()
|
|
session = Session(bind=bind)
|
|
session.execute('ALTER TABLE video DROP COLUMN IF EXISTS censored')
|
|
session.execute('DROP INDEX IF EXISTS video_censored')
|