feat(query_part): refactoring query part

This commit is contained in:
Torkel Ödegaard
2016-08-15 17:20:45 +02:00
parent befca9bb2f
commit 1418cbbd8b
9 changed files with 80 additions and 65 deletions

View File

@@ -12,7 +12,6 @@ func addAnnotationMig(mg *Migrator) {
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "alert_id", Type: DB_BigInt, Nullable: true},
{Name: "user_id", Type: DB_BigInt, Nullable: true},
{Name: "panel_link_id", Type: DB_NVarchar, Length: 32, Nullable: false},
{Name: "type", Type: DB_NVarchar, Length: 25, Nullable: false},
{Name: "title", Type: DB_Text, Nullable: false},
{Name: "text", Type: DB_Text, Nullable: false},
@@ -25,7 +24,6 @@ func addAnnotationMig(mg *Migrator) {
Indices: []*Index{
{Cols: []string{"org_id", "alert_id"}, Type: IndexType},
{Cols: []string{"org_id", "type"}, Type: IndexType},
{Cols: []string{"org_id", "panel_link_id"}, Type: IndexType},
{Cols: []string{"timestamp"}, Type: IndexType},
},
}
@@ -35,6 +33,5 @@ func addAnnotationMig(mg *Migrator) {
// create indices
mg.AddMigration("add index annotation org_id & alert_id ", NewAddIndexMigration(table, table.Indices[0]))
mg.AddMigration("add index annotation org_id & type", NewAddIndexMigration(table, table.Indices[1]))
mg.AddMigration("add index annotation org_id & panel_link_id ", NewAddIndexMigration(table, table.Indices[2]))
mg.AddMigration("add index annotation timestamp", NewAddIndexMigration(table, table.Indices[3]))
mg.AddMigration("add index annotation timestamp", NewAddIndexMigration(table, table.Indices[2]))
}