mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
- Added ManualAPI for manually triggering workflows via GET and POST requests. - Introduced WorkflowAPI for updating workflows with authorization checks. - Created documentation for JavaScript and Webhook components. - Established WorkflowFeatureSet to initialize routing and job processing. - Developed QueueWorkflow service for managing workflow queue operations. - Implemented RunWorkflow service to execute workflows with error handling and logging. - Added utility for loading component metadata dynamically.
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import DataMigrationBase from "./DataMigrationBase";
|
|
import AnalyticsTableColumn from "Common/Types/AnalyticsDatabase/TableColumn";
|
|
import Log from "Common/Models/AnalyticsModels/Log";
|
|
import LogService from "Common/Server/Services/LogService";
|
|
|
|
export default class AddOtelFieldsToLogTable extends DataMigrationBase {
|
|
public constructor() {
|
|
super("AddOtelFieldsToLogTable");
|
|
}
|
|
|
|
public override async migrate(): Promise<void> {
|
|
const columnKeys: string[] = [
|
|
"observedTimeUnixNano",
|
|
"droppedAttributesCount",
|
|
"flags",
|
|
];
|
|
|
|
for (const key of columnKeys) {
|
|
const hasColumn: boolean =
|
|
await LogService.doesColumnExistInDatabase(key);
|
|
|
|
if (!hasColumn) {
|
|
const column: AnalyticsTableColumn | undefined =
|
|
new Log().tableColumns.find((col: AnalyticsTableColumn) => {
|
|
return col.key === key;
|
|
});
|
|
|
|
if (column) {
|
|
await LogService.addColumnInDatabase(column);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override async rollback(): Promise<void> {
|
|
const columnKeys: string[] = [
|
|
"observedTimeUnixNano",
|
|
"droppedAttributesCount",
|
|
"flags",
|
|
];
|
|
|
|
for (const key of columnKeys) {
|
|
const hasColumn: boolean =
|
|
await LogService.doesColumnExistInDatabase(key);
|
|
|
|
if (hasColumn) {
|
|
await LogService.dropColumnInDatabase(key);
|
|
}
|
|
}
|
|
}
|
|
}
|