mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat(migrations): set default value of groupByMonitor to false for Alert and Incident grouping rules
This commit is contained in:
@@ -674,13 +674,13 @@ export default class AlertGroupingRule extends BaseModel {
|
||||
title: "Group By Monitor",
|
||||
description:
|
||||
"When enabled, alerts from different monitors will be grouped into separate episodes. When disabled, alerts from any monitor can be grouped together.",
|
||||
defaultValue: true,
|
||||
defaultValue: false,
|
||||
isDefaultValueColumn: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
nullable: false,
|
||||
default: true,
|
||||
default: false,
|
||||
})
|
||||
public groupByMonitor?: boolean = undefined;
|
||||
|
||||
|
||||
@@ -678,13 +678,13 @@ export default class IncidentGroupingRule extends BaseModel {
|
||||
title: "Group By Monitor",
|
||||
description:
|
||||
"When enabled, incidents from different monitors will be grouped into separate episodes. When disabled, incidents from any monitor can be grouped together.",
|
||||
defaultValue: true,
|
||||
defaultValue: false,
|
||||
isDefaultValueColumn: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
nullable: false,
|
||||
default: true,
|
||||
default: false,
|
||||
})
|
||||
public groupByMonitor?: boolean = undefined;
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
import CaptureSpan from "../../../Utils/Telemetry/CaptureSpan";
|
||||
|
||||
export class MigrationName1770668054908 implements MigrationInterface {
|
||||
public name = "MigrationName1770668054908";
|
||||
|
||||
@CaptureSpan()
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "IncidentGroupingRule" ALTER COLUMN "groupByMonitor" SET DEFAULT false`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "AlertGroupingRule" ALTER COLUMN "groupByMonitor" SET DEFAULT false`,
|
||||
);
|
||||
}
|
||||
|
||||
@CaptureSpan()
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "IncidentGroupingRule" ALTER COLUMN "groupByMonitor" SET DEFAULT true`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "AlertGroupingRule" ALTER COLUMN "groupByMonitor" SET DEFAULT true`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -253,6 +253,7 @@ import { MigrationName1770232207959 } from "./1770232207959-MigrationName";
|
||||
import { MigrationName1770237245069 } from "./1770237245069-MigrationName";
|
||||
import { MigrationName1770237245070 } from "./1770237245070-MigrationName";
|
||||
import { MigrationName1770407024682 } from "./1770407024682-MigrationName";
|
||||
import { MigrationName1770668054908 } from "./1770668054908-MigrationName";
|
||||
|
||||
export default [
|
||||
InitialMigration,
|
||||
@@ -510,4 +511,5 @@ export default [
|
||||
MigrationName1770237245069,
|
||||
MigrationName1770237245070,
|
||||
MigrationName1770407024682,
|
||||
MigrationName1770668054908,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user