20 lines
526 B
Python
20 lines
526 B
Python
"""Persist an optional caption preference at story creation."""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision = "009"
|
|
down_revision = "008"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
columns = sa.inspect(op.get_bind()).get_columns("visual_drafts")
|
|
if not any(c["name"] == "caption_birth_intent" for c in columns):
|
|
op.add_column("visual_drafts", sa.Column("caption_birth_intent", sa.JSON(), nullable=True))
|
|
|
|
|
|
def downgrade():
|
|
op.drop_column("visual_drafts", "caption_birth_intent")
|