초기화

This commit is contained in:
2026-07-15 18:37:19 +09:00
commit 94abc5461d
1268 changed files with 380198 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from database.connection import get_db_connection
def check():
try:
with get_db_connection() as conn:
with conn.cursor(dictionary=True) as cursor:
# Check tables
cursor.execute("SHOW TABLES")
tables = cursor.fetchall()
print("Tables in database:", [list(t.values())[0] for t in tables])
# Check equipment table structure and data
cursor.execute("DESCRIBE equipment")
cols = cursor.fetchall()
print("\nEquipment columns:")
for c in cols:
print(f" {c['Field']}: {c['Type']}")
cursor.execute("SELECT * FROM equipment")
eqs = cursor.fetchall()
print(f"\nEquipment rows ({len(eqs)}):")
for eq in eqs:
print(" ", eq)
# Check machine_status table structure
cursor.execute("DESCRIBE machine_status")
cols = cursor.fetchall()
print("\nmachine_status columns:")
for c in cols:
print(f" {c['Field']}: {c['Type']}")
cursor.execute("SELECT * FROM machine_status")
statuses = cursor.fetchall()
print(f"\nmachine_status rows ({len(statuses)}):")
for s in statuses:
print(" ", s)
except Exception as e:
print("Error during check:", e)
if __name__ == "__main__":
check()