-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HARMONY-1996: Add work-item status 'warning' and substatus work items
and level/category to job_errors to support warnings as well as errors
- Loading branch information
1 parent
4fe4a84
commit 8551b21
Showing
9 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
db/migrations/20250124155544_add_level_and_category_to_job_errors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex, Promise) { | ||
return knex.schema.raw(` | ||
ALTER TABLE "job_errors" | ||
ADD COLUMN "level" VARCHAR(255) DEFAULT 'error' NOT NULL, | ||
ADD CONSTRAINT "job_errors_level_check" | ||
CHECK (level IN ('error', 'warning')), | ||
ADD COLUMN "category" VARCHAR(255) DEFAULT 'generic' NOT NULL, | ||
ADD CONSTRAINT "job_errors_category_check" | ||
CHECK (category IN ('generic', 'no-data')); | ||
CREATE INDEX job_errors_level ON job_errors (level); | ||
CREATE INDEX job_errors_category ON job_errors (category) | ||
`); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.raw(` | ||
DROP INDEX job_errors_category; | ||
DROP_INDEX job_errors_level; | ||
ALTER TABLE "job_errors" | ||
DROP CONSTRAINT "job_errors_category_check", | ||
DROP COLUMN "category", | ||
DROP CONSTRAINT "job_errors_level_check", | ||
DROP COLUMN "level" | ||
`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters