fediversion/backend/migrations/add_youtube_links.py
fullsizemalt b4cddf41ea feat: Initialize Fediversion multi-band platform
- Fork elmeg-demo codebase for multi-band support
- Add data importer infrastructure with base class
- Create band-specific importers:
  - phish.py: Phish.net API v5
  - grateful_dead.py: Grateful Stats API
  - setlistfm.py: Dead & Company, Billy Strings (Setlist.fm)
- Add spec-kit configuration for Gemini
- Update README with supported bands and architecture
2025-12-28 12:39:28 -08:00

28 lines
864 B
Python

"""
Migration to add youtube_link column to show, song, and performance tables.
"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sqlmodel import Session, create_engine, text
from database import DATABASE_URL
def add_youtube_link_columns():
engine = create_engine(DATABASE_URL)
tables = ['show', 'song', 'performance']
with Session(engine) as session:
for table in tables:
try:
session.exec(text(f"""
ALTER TABLE "{table}" ADD COLUMN IF NOT EXISTS youtube_link VARCHAR
"""))
session.commit()
print(f"✅ Added youtube_link to {table}")
except Exception as e:
print(f"⚠️ {table}: {e}")
if __name__ == "__main__":
add_youtube_link_columns()