Update limits in consumptions
MODIFY
src/migration/MigrationHandler.ts
src/migration/MigrationHandler.ts
@@ -72,7 +72,7 @@ export default class MigrationHandler {
currentMigrationTasks.push(new UpdateChargingStationTemplatesTask());
currentMigrationTasks.push(new UpdateChargingStationStaticLimitationTask());
currentMigrationTasks.push(new AddSiteAreaLimitToConsumptionsTask());
- // CurrentMigrationTasks.push(new UpdateLimitsInConsumptionsTask());
+ currentMigrationTasks.push(new UpdateLimitsInConsumptionsTask());
// Get the already done migrations from the DB
const migrationTasksDone = await MigrationStorage.getMigrations();
// Check

MODIFY
src/migration/tasks/AddSiteAreaLimitToConsumptionsTask.ts
src/migration/tasks/AddSiteAreaLimitToConsumptionsTask.ts
@@ -49,7 +49,7 @@ export default class AddSiteAreaLimitToConsumptionsTask extends MigrationTask {
}
}
// Update Consumption
- limitSiteAreaWatts = limitSiteAreaWatts > limitChargingStationsWatts ? limitSiteAreaWatts : limitChargingStationsWatts;
+ limitSiteAreaWatts = limitSiteAreaWatts ? limitSiteAreaWatts : limitChargingStationsWatts;
const result = await global.database.getCollection(tenant.id, 'consumptions').updateMany(
{
siteAreaID: Utils.convertToObjectID(siteArea.id),
@@ -90,7 +90,7 @@ export default class AddSiteAreaLimitToConsumptionsTask extends MigrationTask {
}
getVersion() {
- return '1.2';
+ return '1.3';
}
getName() {

Update limits in consumptions