Big-Link-Man/scripts/check_migration.py

25 lines
711 B
Python

import sqlite3
conn = sqlite3.connect('content_automation.db')
cursor = conn.cursor()
print("=== Site Deployments Table Schema ===\n")
cursor.execute('SELECT sql FROM sqlite_master WHERE type="table" AND name="site_deployments"')
print(cursor.fetchone()[0])
print("\n\n=== Indexes ===\n")
cursor.execute('SELECT sql FROM sqlite_master WHERE type="index" AND tbl_name="site_deployments"')
for row in cursor.fetchall():
if row[0]:
print(row[0])
print("\n\n=== Column Details ===\n")
cursor.execute('PRAGMA table_info(site_deployments)')
for col in cursor.fetchall():
nullable = "NULL" if col[3] == 0 else "NOT NULL"
print(f"{col[1]}: {col[2]} {nullable}")
conn.close()
print("\n[DONE]")