This commit is contained in:
h
2026-04-15 13:57:56 +09:00
parent 696e1b9c9f
commit b597453fac

View File

@@ -68,7 +68,6 @@ if (!carCols.includes('sort_order')) {
db.exec('ALTER TABLE cars ADD COLUMN sort_order INTEGER DEFAULT 0'); db.exec('ALTER TABLE cars ADD COLUMN sort_order INTEGER DEFAULT 0');
db.exec('UPDATE cars SET sort_order = id'); db.exec('UPDATE cars SET sort_order = id');
} }
db.prepare("UPDATE cars SET tire_type = 'スタッドレス' WHERE tire_type = 'スタットレス'").run();
// Migrate: add period fields to reservations if they don't exist yet // Migrate: add period fields to reservations if they don't exist yet
const resCols = db.prepare("PRAGMA table_info(reservations)").all().map((c) => c.name); const resCols = db.prepare("PRAGMA table_info(reservations)").all().map((c) => c.name);
@@ -100,17 +99,13 @@ function broadcast(message) {
}); });
} }
function normalizeTireType(value) { // for future use
return value === 'スタットレス' ? 'スタッドレス' : value;
}
function normalizeCar(car) { function normalizeCar(car) {
if (!car) { if (!car) {
return car; return car;
} }
return { return {
...car, ...car,
tire_type: normalizeTireType(car.tire_type),
}; };
} }