From cfd127dfab4519b47bc485dbb5c85089d972dfef Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Fri, 20 Feb 2026 04:27:46 -0500 Subject: [PATCH] refactor: migrate player_positions table to add label column for enhanced data tracking --- server/database.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 (