diff --git a/backend/config/database.php b/backend/config/database.php index 049ce79..70b850c 100644 --- a/backend/config/database.php +++ b/backend/config/database.php @@ -16,7 +16,6 @@ function getDbConnection() { } function migrate($db) { - // Create tables using the main connection $db->exec("CREATE TABLE IF NOT EXISTS network_shapes ( id INT AUTO_INCREMENT PRIMARY KEY, label VARCHAR(255) NOT NULL DEFAULT '', @@ -39,10 +38,6 @@ function migrate($db) { role ENUM('admin','user') DEFAULT 'user', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )"); - // Connect as root for schema changes - try { - $root = new PDO("mysql:host=" . (getenv('DB_HOST') ?: 'mysql') . ";dbname=" . (getenv('DB_NAME') ?: 'neptune') . ";charset=utf8mb4", 'root', getenv('MYSQL_ROOT_PASSWORD') ?: 'neptune_root_pass'); - $root->exec("CREATE TABLE IF NOT EXISTS node_notes (node_id INT PRIMARY KEY, notes TEXT DEFAULT '')"); - } catch (Exception $e) { - } + $db->exec("CREATE TABLE IF NOT EXISTS node_notes (node_id INT PRIMARY KEY, notes TEXT DEFAULT '')"); +} } \ No newline at end of file