diff --git a/internal/lookout/schema/migrations/033_drop_failure_info_from_job_run.sql b/internal/lookout/schema/migrations/033_drop_failure_info_from_job_run.sql new file mode 100644 index 00000000000..0fd4d21e278 --- /dev/null +++ b/internal/lookout/schema/migrations/033_drop_failure_info_from_job_run.sql @@ -0,0 +1 @@ +ALTER TABLE job_run DROP COLUMN IF EXISTS failure_info; diff --git a/internal/lookouthc/schema/migrations/001_initial_schema.sql b/internal/lookouthc/schema/migrations/001_initial_schema.sql index 3a5aaafebf3..ba848ba2d73 100644 --- a/internal/lookouthc/schema/migrations/001_initial_schema.sql +++ b/internal/lookouthc/schema/migrations/001_initial_schema.sql @@ -117,7 +117,6 @@ CREATE TABLE job_run ( debug bytea NULL, pool text NULL, ingress_addresses jsonb NULL, - failure_info jsonb NULL, failure_category varchar(63) NULL, failure_subcategory varchar(63) NULL ) WITH (fillfactor = 70); diff --git a/internal/server/queryapi/database/models.go b/internal/server/queryapi/database/models.go index 52f6a64edaf..9aca2755812 100644 --- a/internal/server/queryapi/database/models.go +++ b/internal/server/queryapi/database/models.go @@ -60,7 +60,6 @@ type JobRun struct { Debug []byte `db:"debug"` Pool *string `db:"pool"` IngressAddresses []byte `db:"ingress_addresses"` - FailureInfo []byte `db:"failure_info"` FailureCategory *string `db:"failure_category"` FailureSubcategory *string `db:"failure_subcategory"` } diff --git a/internal/server/queryapi/database/query.sql.go b/internal/server/queryapi/database/query.sql.go index aec6fce4c8b..fd8d26da00e 100644 --- a/internal/server/queryapi/database/query.sql.go +++ b/internal/server/queryapi/database/query.sql.go @@ -126,7 +126,7 @@ func (q *Queries) GetJobErrorsByJobIds(ctx context.Context, jobIds []string) ([] } const getJobRunsByJobIds = `-- name: GetJobRunsByJobIds :many -SELECT run_id, job_id, cluster, node, pending, started, finished, job_run_state, error, exit_code, leased, debug, pool, ingress_addresses, failure_info, failure_category, failure_subcategory FROM job_run WHERE job_id = ANY($1::text[]) order by leased desc +SELECT run_id, job_id, cluster, node, pending, started, finished, job_run_state, error, exit_code, leased, debug, pool, ingress_addresses, failure_category, failure_subcategory FROM job_run WHERE job_id = ANY($1::text[]) order by leased desc ` func (q *Queries) GetJobRunsByJobIds(ctx context.Context, jobIds []string) ([]JobRun, error) { @@ -153,7 +153,6 @@ func (q *Queries) GetJobRunsByJobIds(ctx context.Context, jobIds []string) ([]Jo &i.Debug, &i.Pool, &i.IngressAddresses, - &i.FailureInfo, &i.FailureCategory, &i.FailureSubcategory, ); err != nil { @@ -168,7 +167,7 @@ func (q *Queries) GetJobRunsByJobIds(ctx context.Context, jobIds []string) ([]Jo } const getJobRunsByRunIds = `-- name: GetJobRunsByRunIds :many -SELECT run_id, job_id, cluster, node, pending, started, finished, job_run_state, error, exit_code, leased, debug, pool, ingress_addresses, failure_info, failure_category, failure_subcategory FROM job_run WHERE run_id = ANY($1::text[]) +SELECT run_id, job_id, cluster, node, pending, started, finished, job_run_state, error, exit_code, leased, debug, pool, ingress_addresses, failure_category, failure_subcategory FROM job_run WHERE run_id = ANY($1::text[]) ` func (q *Queries) GetJobRunsByRunIds(ctx context.Context, runIds []string) ([]JobRun, error) { @@ -195,7 +194,6 @@ func (q *Queries) GetJobRunsByRunIds(ctx context.Context, runIds []string) ([]Jo &i.Debug, &i.Pool, &i.IngressAddresses, - &i.FailureInfo, &i.FailureCategory, &i.FailureSubcategory, ); err != nil {