Remove logo from Tenant collection
MODIFY
src/migration/MigrationHandler.ts
src/migration/MigrationHandler.ts
@@ -9,6 +9,7 @@ import Logging from '../utils/Logging';
import MigrationStorage from '../storage/mongodb/MigrationStorage';
import MigrationTask from './MigrationTask';
import RemoveDuplicateTagVisualIDsTask from './tasks/RemoveDuplicateTagVisualIDsTask';
+import RemoveLogoFromTenantTask from './tasks/RemoveLogoFromTenantTask';
import RepairInvoiceInconsistencies from './tasks/RepairInvoiceInconsistencies';
import RepairTransactionBillingData from './tasks/RepairTransactionBillingData';
import RepairTransactionPricedAtZero from './tasks/RepairTransactionPricedAtZeroTask';
@@ -150,6 +151,7 @@ export default class MigrationHandler {
currentMigrationTasks.push(new UpdateEmailsToLowercaseTask());
currentMigrationTasks.push(new UserCleanUpTask());
currentMigrationTasks.push(new AlignEntitiesWithOrganizationIDsTask());
+ currentMigrationTasks.push(new RemoveLogoFromTenantTask());
return currentMigrationTasks;
}
}

ADD
src/migration/tasks/RemoveLogoFromTenantTask.ts
+import Constants from '../../utils/Constants';
+import MigrationTask from '../MigrationTask';
+import global from '../../types/GlobalType';
+
+export default class RemoveLogoFromTenantTask extends MigrationTask {
+ public async migrate() {
+ // Clean up
+ await global.database.getCollection(Constants.DEFAULT_TENANT, 'tenants').updateMany(
+ {},
+ { $unset: { logo: '' } }
+ );
+ }
+
+ public getVersion(): string {
+ return '1.0';
+ }
+
+ public getName(): string {
+ return 'RemoveLogoFromTenantTask';
+ }
+
+ public isAsynchronous(): boolean {
+ return true;
+ }
+}

Remove logo from Tenant collection