#!/usr/bin/env python3
"""Quick check script"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from app.core.database import engine
from sqlalchemy import text

conn = engine.connect()
result = conn.execute(text("SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name='item_type_definitions')"))
exists = result.fetchone()[0]
print(f"item_type_definitions table exists: {exists}")

if not exists:
    print("\n⚠ Table does not exist. Need to run migration.")
    print("Expected behavior: Migration creates this table.")
else:
    print("\n✓ Table exists!")
    # Count records
    count_result = conn.execute(text("SELECT COUNT(*) FROM item_type_definitions"))
    count = count_result.fetchone()[0]
    print(f"  Records: {count}")

conn.close()
