Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
Signed-off-by: robinbraemer <[email protected]>
  • Loading branch information
robinbraemer committed Oct 18, 2024
1 parent 0c242a0 commit bea33ec
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pkg/storage/installation_store_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,6 @@ func NewInstallationStoreSQL(db *gorm.DB) *InstallationStoreSQL {
}
}

// EnsureInstallationIndicesSQL creates indices on the installations table.
// TODO move to gorm migration step
func EnsureInstallationIndicesSQL(ctx context.Context, db *gorm.DB) error {
ctx, span := tracing.StartSpan(ctx)
defer span.EndSpan()

span.Debug("Initializing installation table indices")

// Create indices similar to MongoDB
err := db.WithContext(ctx).Exec(`
CREATE UNIQUE INDEX IF NOT EXISTS idx_installations_namespace_name ON installations (namespace, name);
CREATE INDEX IF NOT EXISTS idx_runs_namespace_installation ON runs (namespace, installation);
CREATE INDEX IF NOT EXISTS idx_results_namespace_installation ON results (namespace, installation);
CREATE INDEX IF NOT EXISTS idx_results_run_id ON results (run_id);
CREATE INDEX IF NOT EXISTS idx_outputs_namespace_installation_result_id ON outputs (namespace, installation, result_id DESC);
CREATE UNIQUE INDEX IF NOT EXISTS idx_outputs_result_id_name ON outputs (result_id, name);
CREATE INDEX IF NOT EXISTS idx_outputs_namespace_installation_name_result_id ON outputs (namespace, installation, name, result_id DESC);
`).Error

return span.Error(err)
}

func (s *InstallationStoreSQL) ListInstallations(ctx context.Context, listOptions ListOptions) ([]Installation, error) {
_, log := tracing.StartSpan(ctx)
defer log.EndSpan()
Expand Down

0 comments on commit bea33ec

Please sign in to comment.