#!/usr/bin/env python3

import sqlite3
import json

def verify_custom_types():
    conn = sqlite3.connect('database.db')
    cursor = conn.cursor()
    
    # Check projects table structure
    cursor.execute("PRAGMA table_info(projects)")
    columns = cursor.fetchall()
    print("Projects table columns:")
    for col in columns:
        print(f"  {col[1]} ({col[2]})")
    
    print("\n" + "="*50)
    
    # Check existing projects and their custom task types
    cursor.execute('SELECT id, name, custom_asset_task_types, custom_shot_task_types FROM projects')
    projects = cursor.fetchall()
    
    print("Projects with custom task types:")
    for project in projects:
        project_id, name, custom_asset_types_json, custom_shot_types_json = project
        
        custom_asset_types = json.loads(custom_asset_types_json) if custom_asset_types_json else []
        custom_shot_types = json.loads(custom_shot_types_json) if custom_shot_types_json else []
        
        print(f"\nProject ID: {project_id}")
        print(f"Name: {name}")
        print(f"Custom Asset Types: {custom_asset_types}")
        print(f"Custom Shot Types: {custom_shot_types}")
    
    conn.close()

if __name__ == "__main__":
    verify_custom_types()