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.
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import DataMigrationBase from "./DataMigrationBase";
|
|
import AnalyticsTableColumn from "Common/Types/AnalyticsDatabase/TableColumn";
|
|
import ExceptionInstance from "Common/Models/AnalyticsModels/ExceptionInstance";
|
|
import ExceptionInstanceService from "Common/Server/Services/ExceptionInstanceService";
|
|
|
|
export default class AddColumnsToExceptionInstance extends DataMigrationBase {
|
|
public constructor() {
|
|
super("AddColumnsToExceptionInstance");
|
|
}
|
|
|
|
public override async migrate(): Promise<void> {
|
|
const columnKeys: string[] = ["release", "environment", "parsedFrames"];
|
|
|
|
for (const key of columnKeys) {
|
|
const hasColumn: boolean =
|
|
await ExceptionInstanceService.doesColumnExistInDatabase(key);
|
|
|
|
if (!hasColumn) {
|
|
const column: AnalyticsTableColumn | undefined =
|
|
new ExceptionInstance().tableColumns.find(
|
|
(col: AnalyticsTableColumn) => {
|
|
return col.key === key;
|
|
},
|
|
);
|
|
|
|
if (column) {
|
|
await ExceptionInstanceService.addColumnInDatabase(column);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override async rollback(): Promise<void> {
|
|
const columnKeys: string[] = ["release", "environment", "parsedFrames"];
|
|
|
|
for (const key of columnKeys) {
|
|
const hasColumn: boolean =
|
|
await ExceptionInstanceService.doesColumnExistInDatabase(key);
|
|
|
|
if (hasColumn) {
|
|
await ExceptionInstanceService.dropColumnInDatabase(key);
|
|
}
|
|
}
|
|
}
|
|
}
|