Fix SQL columns.
This commit adds the missing 'org' column to the builds_per_change metric and renames the column 'change' since it's a keyword.
@@ -80,8 +80,8 @@ func getChangeNumber(build buildkite.Build) (int, error) {
return changeNumber, nil
}
-// CREATE TABLE builds_per_change (pipeline VARCHAR(255), change INT, builds INT, PRIMARY KEY(pipeline, change));
+// CREATE TABLE builds_per_change (org VARCHAR(255), pipeline VARCHAR(255), changelist INT, builds INT, PRIMARY KEY(org, pipeline, changelist));
func CreateBuildsPerChange(client *clients.BuildkiteClient, builds int, pipelines ...*data.PipelineID) *BuildsPerChange {
- columns := []Column{Column{"pipeline", true}, Column{"change", true}, Column{"builds", false}}
+ columns := []Column{Column{"org", true}, Column{"pipeline", true}, Column{"changelist", true}, Column{"builds", false}}
return &BuildsPerChange{client: client, pipelines: pipelines, columns: columns, builds: builds}
}
