feat(alerting): cleanup, removed alert changes table and code

This commit is contained in:
Torkel Ödegaard
2016-07-13 11:58:55 +02:00
parent d9096110f8
commit 624cd6fc0a
7 changed files with 5 additions and 246 deletions
+4 -17
View File
@@ -14,7 +14,7 @@ func addAlertMigrations(mg *Migrator) {
{Name: "panel_id", Type: DB_BigInt, Nullable: false},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "description", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "description", Type: DB_Text, Nullable: false},
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "settings", Type: DB_Text, Nullable: false},
{Name: "frequency", Type: DB_BigInt, Nullable: false},
@@ -22,34 +22,21 @@ func addAlertMigrations(mg *Migrator) {
{Name: "enabled", Type: DB_Bool, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
{Name: "updated_by", Type: DB_BigInt, Nullable: false},
{Name: "created_by", Type: DB_BigInt, Nullable: false},
},
}
// create table
mg.AddMigration("create alert table v1", NewAddTableMigration(alertV1))
alert_changes := Table{
Name: "alert_change",
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: "type", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated_by", Type: DB_BigInt, Nullable: false},
{Name: "new_alert_settings", Type: DB_Text, Nullable: false},
},
}
mg.AddMigration("create alert_change table v1", NewAddTableMigration(alert_changes))
alert_state_log := Table{
Name: "alert_state",
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: "new_state", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "state", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "info", Type: DB_Text, Nullable: true},
{Name: "triggered_alerts", Type: DB_Text, Nullable: true},
{Name: "created", Type: DB_DateTime, Nullable: false},