#!/usr/bin/env python3 """ Quick test to verify the database schema matches between app and preprocessor. """ import sys sys.path.insert(0, "/home/oluwasanmi/Documents/Work/MKD/anton_wireframe/app") from db.db import engine from sqlalchemy import inspect # Get table info inspector = inspect(engine) print("šŸ” Checking database schema...") print(f"Database: {engine.url}\n") # Check investors table if "investors" in inspector.get_table_names(): print("āœ… 'investors' table exists") columns = inspector.get_columns("investors") print("\nColumns in 'investors' table:") for col in columns: print(f" - {col['name']}: {col['type']}") # Check for stage_focus column_names = [col["name"] for col in columns] if "stage_focus" in column_names: print("\nāš ļø WARNING: 'stage_focus' column still exists in database!") print(" This should be removed as it's deprecated.") else: print("\nāœ… Good: 'stage_focus' column not in database (as expected)") # Check for required columns required_columns = [ "aum", "investment_thesis", "portfolio_highlights", "linked_documents", "researcher_notes", "sources", ] missing = [col for col in required_columns if col not in column_names] if missing: print(f"\nāŒ Missing columns: {', '.join(missing)}") else: print("\nāœ… All required enriched columns present") else: print("āŒ 'investors' table not found!") print("\n" + "=" * 60) print("Schema verification complete!") print("=" * 60)