@@ -16,7 +16,6 @@ function getDbConnection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function migrate($db) {
|
function migrate($db) {
|
||||||
// Create tables using the main connection
|
|
||||||
$db->exec("CREATE TABLE IF NOT EXISTS network_shapes (
|
$db->exec("CREATE TABLE IF NOT EXISTS network_shapes (
|
||||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
label VARCHAR(255) NOT NULL DEFAULT '',
|
label VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
@@ -39,10 +38,6 @@ function migrate($db) {
|
|||||||
role ENUM('admin','user') DEFAULT 'user',
|
role ENUM('admin','user') DEFAULT 'user',
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
)");
|
)");
|
||||||
// Connect as root for schema changes
|
$db->exec("CREATE TABLE IF NOT EXISTS node_notes (node_id INT PRIMARY KEY, notes TEXT DEFAULT '')");
|
||||||
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) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user