feat(alerting): renames alert table to alert_rule
This commit is contained in:
@@ -3,10 +3,8 @@ package migrations
|
||||
import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
|
||||
func addAlertMigrations(mg *Migrator) {
|
||||
mg.AddMigration("Drop old table alert table", NewDropTableMigration("alert"))
|
||||
|
||||
alertV1 := Table{
|
||||
Name: "alert",
|
||||
Name: "alert_rule",
|
||||
Columns: []*Column{
|
||||
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
|
||||
{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
|
||||
@@ -25,4 +23,16 @@ func addAlertMigrations(mg *Migrator) {
|
||||
|
||||
// create table
|
||||
mg.AddMigration("create alert table v1", NewAddTableMigration(alertV1))
|
||||
|
||||
alert_changes := Table{
|
||||
Name: "alert_rule_updates",
|
||||
Columns: []*Column{
|
||||
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
|
||||
{Name: "alert_id", Type: DB_BigInt, Nullable: false},
|
||||
{Name: "org_id", Type: DB_BigInt, Nullable: false},
|
||||
{Name: "created", Type: DB_DateTime, Nullable: false},
|
||||
},
|
||||
}
|
||||
|
||||
mg.AddMigration("create alert_rules_updates table v1", NewAddTableMigration(alert_changes))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user