🗑️ chore: remove unused database and routing scripts; update cached Python bytecode files in __pycache__ directories
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
38
utils/check_db.py
Normal file
38
utils/check_db.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import sqlite3
|
||||
|
||||
def check_mindmap_nodes():
|
||||
try:
|
||||
conn = sqlite3.connect('database/systades.db')
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Check if the table exists
|
||||
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='mind_map_node';")
|
||||
table_exists = cursor.fetchone()
|
||||
|
||||
if not table_exists:
|
||||
print("Die Tabelle 'mind_map_node' existiert nicht!")
|
||||
return
|
||||
|
||||
# Check for the "Wissen" node
|
||||
cursor.execute("SELECT * FROM mind_map_node WHERE name = 'Wissen';")
|
||||
wissen_node = cursor.fetchone()
|
||||
|
||||
if wissen_node:
|
||||
print(f"'Wissen'-Knoten gefunden: {wissen_node}")
|
||||
else:
|
||||
print("'Wissen'-Knoten NICHT gefunden!")
|
||||
|
||||
# Get all nodes
|
||||
cursor.execute("SELECT id, name FROM mind_map_node LIMIT 10;")
|
||||
nodes = cursor.fetchall()
|
||||
|
||||
print(f"\nVorhandene Knoten (max. 10):")
|
||||
for node in nodes:
|
||||
print(f" - {node}")
|
||||
|
||||
conn.close()
|
||||
except Exception as e:
|
||||
print(f"Fehler: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_mindmap_nodes()
|
||||
103
utils/db_operations.py
Normal file
103
utils/db_operations.py
Normal file
@@ -0,0 +1,103 @@
|
||||
import sqlite3
|
||||
import os
|
||||
import random
|
||||
|
||||
# Verbindung zur Datenbank herstellen
|
||||
db_path = os.path.join(os.getcwd(), 'database', 'systades.db')
|
||||
conn = sqlite3.connect(db_path)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Schema der mind_map_node Tabelle anzeigen
|
||||
cursor.execute("PRAGMA table_info(mind_map_node)")
|
||||
columns = cursor.fetchall()
|
||||
print("Tabellenschema mind_map_node:")
|
||||
for column in columns:
|
||||
print(f"{column[1]} ({column[2]})")
|
||||
|
||||
# Existierende Knoten anzeigen
|
||||
cursor.execute("SELECT id, name, description, color_code FROM mind_map_node LIMIT 5")
|
||||
existing_nodes = cursor.fetchall()
|
||||
print("\nBestehende Knoten:")
|
||||
for node in existing_nodes:
|
||||
print(f"ID: {node[0]}, Name: {node[1]}, Beschreibung: {node[2]}")
|
||||
|
||||
# Mögliche Kategorien abrufen (für die Verknüpfung)
|
||||
cursor.execute("SELECT id, name FROM category")
|
||||
categories = cursor.fetchall()
|
||||
print("\nVerfügbare Kategorien:")
|
||||
for category in categories:
|
||||
print(f"ID: {category[0]}, Name: {category[1]}")
|
||||
|
||||
# Wissenschaftliche Themengebiete für neue Knoten
|
||||
scientific_nodes = [
|
||||
{
|
||||
"name": "Quantenphysik",
|
||||
"description": "Die Quantenphysik befasst sich mit dem Verhalten von Materie und Energie auf atomarer und subatomarer Ebene.",
|
||||
"color_code": "#4B0082", # Indigo
|
||||
"icon": "fa-atom"
|
||||
},
|
||||
{
|
||||
"name": "Neurowissenschaften",
|
||||
"description": "Interdisziplinäre Wissenschaft, die sich mit der Struktur und Funktion des Nervensystems und des Gehirns beschäftigt.",
|
||||
"color_code": "#FF4500", # Orange-Rot
|
||||
"icon": "fa-brain"
|
||||
},
|
||||
{
|
||||
"name": "Künstliche Intelligenz",
|
||||
"description": "Forschungsgebiet der Informatik, das sich mit der Automatisierung intelligenten Verhaltens befasst.",
|
||||
"color_code": "#008080", # Teal
|
||||
"icon": "fa-robot"
|
||||
},
|
||||
{
|
||||
"name": "Klimaforschung",
|
||||
"description": "Wissenschaftliche Untersuchung des Klimas, seiner Variationen und Veränderungen auf allen zeitlichen und räumlichen Skalen.",
|
||||
"color_code": "#2E8B57", # Seegrün
|
||||
"icon": "fa-cloud-sun"
|
||||
},
|
||||
{
|
||||
"name": "Genetik",
|
||||
"description": "Teilgebiet der Biologie, das sich mit Vererbung sowie der Funktion und Wirkung von Genen beschäftigt.",
|
||||
"color_code": "#800080", # Lila
|
||||
"icon": "fa-dna"
|
||||
},
|
||||
{
|
||||
"name": "Astrophysik",
|
||||
"description": "Zweig der Astronomie, der sich mit den physikalischen Eigenschaften des Universums befasst.",
|
||||
"color_code": "#191970", # Mitternachtsblau
|
||||
"icon": "fa-star"
|
||||
}
|
||||
]
|
||||
|
||||
# Neue Knoten hinzufügen
|
||||
print("\nFüge neue wissenschaftliche Knoten hinzu...")
|
||||
for node in scientific_nodes:
|
||||
# Prüfen, ob der Knoten bereits existiert
|
||||
cursor.execute("SELECT id FROM mind_map_node WHERE name = ?", (node["name"],))
|
||||
existing = cursor.fetchone()
|
||||
if existing:
|
||||
print(f"Knoten '{node['name']}' existiert bereits mit ID {existing[0]}")
|
||||
continue
|
||||
|
||||
# Zufällige Kategorie wählen, wenn vorhanden
|
||||
category_id = None
|
||||
if categories:
|
||||
category_id = random.choice(categories)[0]
|
||||
|
||||
# Neuen Knoten einfügen
|
||||
cursor.execute("""
|
||||
INSERT INTO mind_map_node (name, description, color_code, icon, is_public, category_id)
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
""", (
|
||||
node["name"],
|
||||
node["description"],
|
||||
node["color_code"],
|
||||
node["icon"],
|
||||
True,
|
||||
category_id
|
||||
))
|
||||
print(f"Knoten '{node['name']}' hinzugefügt")
|
||||
|
||||
# Änderungen übernehmen und Verbindung schließen
|
||||
conn.commit()
|
||||
print("\nDatenbank erfolgreich aktualisiert!")
|
||||
conn.close()
|
||||
BIN
utils/fix_routes.py
Normal file
BIN
utils/fix_routes.py
Normal file
Binary file not shown.
BIN
utils/update_routes.py
Normal file
BIN
utils/update_routes.py
Normal file
Binary file not shown.
Reference in New Issue
Block a user