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
This commit is contained in:
Ian Keane 2026-06-11 10:05:23 -04:00
parent 064e672ab7
commit 507531fbff
7 changed files with 252 additions and 10 deletions

View file

@ -0,0 +1,29 @@
"""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")