repertory-api/migrations/versions/c3f8a1e924d5_add_created_at_to_tunes.py
Ian Keane 507531fbff Changes for refactor of references view, add unique keys for some tables
References sites table updated so we can filter by site later, added
timestamp to tunes so they can be sorted in certain contexts, enforced
uniqueness on some tables that were causing issues
2026-06-11 10:05:23 -04:00

29 lines
552 B
Python

"""add created_at to tunes
Revision ID: c3f8a1e924d5
Revises: 57326830536b
Create Date: 2026-06-09
"""
from alembic import op
import sqlalchemy as sa
revision = "c3f8a1e924d5"
down_revision = "57326830536b"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column(
"tunes",
sa.Column(
"created_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=True,
),
)
def downgrade() -> None:
op.drop_column("tunes", "created_at")