refactor: migrate player_positions table to add label column for enhanced data tracking

This commit is contained in:
MayaTheShy
2026-02-20 04:27:46 -05:00
parent d2718b3287
commit cfd127dfab

View File

@@ -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 (