oneuptime/Worker/DataMigrations/DeleteOldTelelmetryTable.ts
Nawaz Dhandala 6d5bc111ba
Refactor comments across multiple files to improve clarity and consistency
- Updated comments in Probe/Config.ts to use block comments for proxy configuration.
- Refactored comments in PortMonitor.ts, SyntheticMonitor.ts, and OnlineCheck.ts to block comments for better readability.
- Adjusted comments in ProbeIngest/API/Monitor.ts and ProbeIngest/API/Probe.ts to block comments for clarity.
- Standardized comments in various data migration scripts to block comments for consistency.
- Modified eslint.config.js to enforce multiline comment style as an error.
2025-10-02 11:53:55 +01:00

29 lines
955 B
TypeScript

import DataMigrationBase from "./DataMigrationBase";
import LogService from "Common/Server/Services/LogService";
import MetricService from "Common/Server/Services/MetricService";
import SpanService from "Common/Server/Services/SpanService";
import logger from "Common/Server/Utils/Logger";
export default class DeleteOldTelemetryTable extends DataMigrationBase {
public constructor() {
super("DeleteOldTelemetryTable");
}
public override async migrate(): Promise<void> {
try {
/*
* delete old telemetry tables that are no longer needed
* we have renamed these tables to new names
*/
await MetricService.executeQuery("DROP TABLE IF EXISTS Metric");
await SpanService.executeQuery("DROP TABLE IF EXISTS Span");
await LogService.executeQuery("DROP TABLE IF EXISTS Log");
} catch (err) {
logger.error(err);
}
}
public override async rollback(): Promise<void> {
return;
}
}