LinkDesk/backend/check_db_schema.py

37 lines
909 B
Python

#!/usr/bin/env python3
"""
Check database schema for enum constraints.
"""
import sqlite3
def check_db_schema():
"""Check database schema for enum constraints."""
print("Checking Database Schema")
print("=" * 30)
db_path = "vfx_project_management.db"
try:
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Get the CREATE TABLE statement for projects
cursor.execute("SELECT sql FROM sqlite_master WHERE type='table' AND name='projects'")
create_sql = cursor.fetchone()
if create_sql:
print("Projects table CREATE statement:")
print(create_sql[0])
else:
print("Projects table not found")
except Exception as e:
print(f"Error: {e}")
finally:
if conn:
conn.close()
if __name__ == "__main__":
check_db_schema()