Alerting: Add message to alert_rule_version table (Part 1). (#114194)
This adds a `message` column to the `alert_rule_version` table. This follows the pattern established for dashboards as closely as possible. A new type is introduced internally for passing the new `message` field around in a type-safe manner, but doing the same for the API types becomes very messy. In that case, a new field is added with omitempty. Note this PR is only: - The column addition - The "read" path; API for listing versions Subsequent PRs will add code to actually set the message when updating rules.
This commit is contained in:
@@ -24,6 +24,9 @@ func AddTablesMigrations(mg *migrator.Migrator) {
|
||||
mg.AddMigration("add last_applied column to alert_configuration_history", migrator.NewAddColumnMigration(migrator.Table{Name: "alert_configuration_history"}, &migrator.Column{
|
||||
Name: "last_applied", Type: migrator.DB_Int, Nullable: false, Default: "0",
|
||||
}))
|
||||
mg.AddMigration("add message column to alert_rule_version", migrator.NewAddColumnMigration(migrator.Table{Name: "alert_rule_version"}, &migrator.Column{
|
||||
Name: "message", Type: migrator.DB_Text, Nullable: true,
|
||||
}))
|
||||
// End of migration log, add new migrations above this line.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user