feat(alerting): renames alert table to alert_rule

This commit is contained in:
bergquist
2016-04-25 14:42:24 +02:00
parent 8ca7ccae38
commit c83af353b2
5 changed files with 30 additions and 20 deletions
+13 -3
View File
@@ -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))
}