based on where the user has went we can for example set a key: true if they collected a key needed to access a section's steps. modified: app.py new file: migrations/versions/d737de68d6fa_add_metadata_field_to_activitystate.py new file: research/activity14-choose-adventure.yaml
32 lines
848 B
Python
32 lines
848 B
Python
"""Add metadata field to ActivityState
|
|
|
|
Revision ID: d737de68d6fa
|
|
Revises: d04950c5a624
|
|
Create Date: 2024-07-28 17:02:11.872502
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "d737de68d6fa"
|
|
down_revision = "d04950c5a624"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("activity_state", schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column("json_metadata", sa.UnicodeText(), server_default="{}"))
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("activity_state", schema=None) as batch_op:
|
|
batch_op.drop_column("json_metadata")
|
|
|
|
# ### end Alembic commands ###
|