malepati/custom_template_working
0
1import sqlite32 3db_path = r"c:\Users\DELL\Documents\upgrading\Accusaga_slides_presentation\servers\fastapi\app_data\fastapi.db"4conn = sqlite3.connect(db_path)5cursor = conn.cursor()6 7print("--- ORPHAN CHECK ---")8cursor.execute("""9 SELECT DISTINCT presentation 10 FROM presentation_layout_codes 11 WHERE presentation NOT IN (SELECT id FROM templates)12""")13orphans = cursor.fetchall()14 15if orphans:16 print(f"Found {len(orphans)} orphaned presentation IDs in layout codes:")17 for o in orphans:18 print(f" - {o[0]}")19else:20 print("No orphans found. All layouts have parent templates.")21 22conn.close()23 