|
|
@@ -15,6 +15,7 @@ func addAnnotationMig(mg *Migrator) {
|
|
|
{Name: "user_id", Type: DB_BigInt, Nullable: true},
|
|
|
{Name: "dashboard_id", Type: DB_BigInt, Nullable: true},
|
|
|
{Name: "panel_id", Type: DB_BigInt, Nullable: true},
|
|
|
+ {Name: "category_id", Type: DB_BigInt, Nullable: true},
|
|
|
{Name: "type", Type: DB_NVarchar, Length: 25, Nullable: false},
|
|
|
{Name: "title", Type: DB_Text, Nullable: false},
|
|
|
{Name: "text", Type: DB_Text, Nullable: false},
|
|
|
@@ -27,18 +28,20 @@ func addAnnotationMig(mg *Migrator) {
|
|
|
Indices: []*Index{
|
|
|
{Cols: []string{"org_id", "alert_id"}, Type: IndexType},
|
|
|
{Cols: []string{"org_id", "type"}, Type: IndexType},
|
|
|
- {Cols: []string{"dashboard_id", "panel_id"}, Type: IndexType},
|
|
|
- {Cols: []string{"epoch"}, Type: IndexType},
|
|
|
+ {Cols: []string{"org_id", "category_id"}, Type: IndexType},
|
|
|
+ {Cols: []string{"org_id", "dashboard_id", "panel_id", "epoch"}, Type: IndexType},
|
|
|
+ {Cols: []string{"org_id", "epoch"}, Type: IndexType},
|
|
|
},
|
|
|
}
|
|
|
|
|
|
- mg.AddMigration("Drop old annotation table v3", NewDropTableMigration("annotation"))
|
|
|
+ mg.AddMigration("Drop old annotation table v4", NewDropTableMigration("annotation"))
|
|
|
|
|
|
- mg.AddMigration("create annotation table v4", NewAddTableMigration(table))
|
|
|
+ mg.AddMigration("create annotation table v5", NewAddTableMigration(table))
|
|
|
|
|
|
// create indices
|
|
|
- mg.AddMigration("add index annotation org_id & alert_id v3", NewAddIndexMigration(table, table.Indices[0]))
|
|
|
- mg.AddMigration("add index annotation org_id & type v3", NewAddIndexMigration(table, table.Indices[1]))
|
|
|
- mg.AddMigration("add index annotation dashboard_id panel_id", NewAddIndexMigration(table, table.Indices[2]))
|
|
|
- mg.AddMigration("add index annotation epoch v3", NewAddIndexMigration(table, table.Indices[3]))
|
|
|
+ mg.AddMigration("add index annotation 0 v3", NewAddIndexMigration(table, table.Indices[0]))
|
|
|
+ mg.AddMigration("add index annotation 1 v3", NewAddIndexMigration(table, table.Indices[1]))
|
|
|
+ mg.AddMigration("add index annotation 2 v3", NewAddIndexMigration(table, table.Indices[2]))
|
|
|
+ mg.AddMigration("add index annotation 3 v3", NewAddIndexMigration(table, table.Indices[3]))
|
|
|
+ mg.AddMigration("add index annotation 4 v3", NewAddIndexMigration(table, table.Indices[4]))
|
|
|
}
|