import psycopg2
from app.config import settings

def check_columns():
    try:
        conn = psycopg2.connect(settings.DATABASE_URL)
        cur = conn.cursor()
        cur.execute("SELECT column_name FROM information_schema.columns WHERE table_name = 'orders'")
        cols = [r[0] for r in cur.fetchall()]
        print(f"Columns in orders: {cols}")
        conn.close()
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    check_columns()
