Remove project device mirror fields
This commit is contained in:
@@ -33,6 +33,16 @@ const projectDeviceColumns = new Set(
|
||||
const missingProjectDeviceColumns = requiredProjectDeviceColumns.filter(
|
||||
(name) => !projectDeviceColumns.has(name)
|
||||
);
|
||||
const removedProjectDeviceColumns = [
|
||||
"installed_power_per_unit_kw",
|
||||
"demand_factor",
|
||||
"phase_count",
|
||||
"power_factor",
|
||||
"note",
|
||||
];
|
||||
const remainingRemovedProjectDeviceColumns = removedProjectDeviceColumns.filter(
|
||||
(name) => projectDeviceColumns.has(name)
|
||||
);
|
||||
const requiredCircuitColumns = ["control_requirement"];
|
||||
const circuitColumns = new Set(
|
||||
db.prepare("PRAGMA table_info(circuits)").all().map((column) => column.name)
|
||||
@@ -55,6 +65,14 @@ if (missingProjectDeviceColumns.length > 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (remainingRemovedProjectDeviceColumns.length > 0) {
|
||||
console.error(
|
||||
"Transitional project-device columns still present:",
|
||||
remainingRemovedProjectDeviceColumns.join(", ")
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (missingCircuitColumns.length > 0) {
|
||||
console.error("Missing circuit columns:", missingCircuitColumns.join(", "));
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user