PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, ]); $pdo->exec("CREATE DATABASE IF NOT EXISTS ".DB_NAME); echo "Database created successfully (if it didn't exist).\n"; // Now connect to the database and run migrations $pdo = db(); $sql = file_get_contents(__DIR__ . '/migrations/001_create_users_table.sql'); $pdo->exec($sql); echo "Migration successful!\n"; } catch (PDOException $e) { die("Migration failed: " . $e->getMessage() . "\n"); }