diff --git a/server/database.js b/server/database.js index 98457d6..6d06bde 100644 --- a/server/database.js +++ b/server/database.js @@ -160,10 +160,22 @@ export function initializeDatabase() { x INTEGER NOT NULL, y INTEGER NOT NULL, z INTEGER NOT NULL, + label TEXT, updated_at INTEGER NOT NULL ) `); + // Migrate player_positions table to add label column if missing + try { + const tableInfo = db.prepare("PRAGMA table_info(player_positions)").all(); + const columns = tableInfo.map(c => c.name); + if (!columns.includes('label')) { + db.exec('ALTER TABLE player_positions ADD COLUMN label TEXT'); + } + } catch (e) { + // Ignore migration errors + } + // Chunk analysis table (ore density per chunk) db.exec(` CREATE TABLE IF NOT EXISTS chunks (