Files
Stride/migrations/versions/c72418a19e30_add_activity_share_links.py
T

22 lines
627 B
Python

"""Add opt-in public activity share links."""
import sqlalchemy as sa
from alembic import op
revision = "c72418a19e30"
down_revision = "bdbac89195a7"
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("activity") as batch_op:
batch_op.add_column(sa.Column("share_token", sa.String(64), nullable=True))
batch_op.create_unique_constraint("uq_activity_share_token", ["share_token"])
def downgrade():
with op.batch_alter_table("activity") as batch_op:
batch_op.drop_constraint("uq_activity_share_token", type_="unique")
batch_op.drop_column("share_token")