refactor: migrate player_positions table to add label column for enhanced data tracking
This commit is contained in:
@@ -160,10 +160,22 @@ export function initializeDatabase() {
|
|||||||
x INTEGER NOT NULL,
|
x INTEGER NOT NULL,
|
||||||
y INTEGER NOT NULL,
|
y INTEGER NOT NULL,
|
||||||
z INTEGER NOT NULL,
|
z INTEGER NOT NULL,
|
||||||
|
label TEXT,
|
||||||
updated_at INTEGER NOT NULL
|
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)
|
// Chunk analysis table (ore density per chunk)
|
||||||
db.exec(`
|
db.exec(`
|
||||||
CREATE TABLE IF NOT EXISTS chunks (
|
CREATE TABLE IF NOT EXISTS chunks (
|
||||||
|
|||||||
Reference in New Issue
Block a user