fediversion/debug_dmb_deadco.py
fullsizemalt 8b32b71db5
Some checks failed
Deploy Fediversion / deploy (push) Failing after 4s
chore: add debug script
2026-01-07 22:28:27 -08:00

22 lines
977 B
Python

from sqlmodel import Session, select
from database import engine
from models import Vertical, Song, Performance
with Session(engine) as session:
for s in ['dmb', 'dead-and-company']:
v = session.exec(select(Vertical).where(Vertical.slug == s)).first()
print(f"--- {s} ---")
if not v:
print("Vertical missing")
continue
print(f"Vertical ID: {v.id}")
perfs = session.exec(select(Performance).join(Song).where(Song.vertical_id == v.id)).all()
print(f"Total Perfs: {len(perfs)}")
song = session.exec(select(Song).where(Song.title == 'All Along the Watchtower', Song.vertical_id == v.id)).first()
if song:
watchtower_perfs = session.exec(select(Performance).where(Performance.song_id == song.id)).all()
print(f"Watchtower: ID={song.id}, Canon={song.canon_id}, Perfs={len(watchtower_perfs)}")
else:
print("Watchtower: Missing")