-
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.
Merge pull request #531 from nasa/harmony-1622
Harmony 1622 - Better job progress calculation
- Loading branch information
Showing
16 changed files
with
425 additions
and
124 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
22 changes: 22 additions & 0 deletions
22
db/migrations/20240122162340_add_progress_fields_to_workflow_steps.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,22 @@ | ||
exports.up = function up(knex) { | ||
const result = knex.schema | ||
.alterTable('workflow_steps', (t) => { | ||
t.integer('completed_work_item_count').defaultTo(0).notNullable(); | ||
t.float('progress_weight').defaultTo(1).notNullable(); | ||
}) | ||
.then(() => { | ||
return knex.schema.raw(` | ||
UPDATE "workflow_steps" SET completed_work_item_count="workItemCount" WHERE is_complete = true | ||
` | ||
)}); | ||
|
||
return result; | ||
}; | ||
|
||
exports.down = function down(knex) { | ||
return knex.schema | ||
.alterTable('workflow_steps', (t) => { | ||
t.dropColumn('progress_weight'); | ||
t.dropColumn('completed_work_item_count'); | ||
}); | ||
}; |
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
Oops, something went wrong.