[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.
This commit is contained in:
36
ARCHIVE_legacy_scripts/check_db_content.py
Normal file
36
ARCHIVE_legacy_scripts/check_db_content.py
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'company-explorer')))
|
||||
|
||||
from backend.database import SessionLocal, Company
|
||||
|
||||
def check_db_content():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
print("--- Checking content of 'companies' table ---")
|
||||
companies = db.query(Company).limit(5).all()
|
||||
|
||||
if not companies:
|
||||
print("!!! FATAL: The 'companies' table is EMPTY.")
|
||||
# Let's check if the table is there at all
|
||||
try:
|
||||
count = db.query(Company).count()
|
||||
print(f"Row count is confirmed to be {count}.")
|
||||
except Exception as e:
|
||||
print(f"!!! Could not even count rows. The table might be corrupt. Error: {e}")
|
||||
|
||||
else:
|
||||
print(f"Found {len(companies)} companies. Data seems to be present.")
|
||||
for company in companies:
|
||||
print(f" - ID: {company.id}, Name: {company.name}")
|
||||
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_db_content()
|
||||
Reference in New Issue
Block a user