-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix stored enum for source_type for deployment and task
- Loading branch information
1 parent
961286f
commit 56f170f
Showing
5 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
services/api/database/migrations/20241231000000_source_type_enums.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(knex) { | ||
// fix the way the enum values are stored to be lowercase for mysql strict | ||
return Promise.all([ | ||
knex('deployment') | ||
.where('source_type', '=', 'API') | ||
.update('source_type', 'api'), | ||
knex('deployment') | ||
.where('source_type', '=', 'WEBHOOK') | ||
.update('source_type', 'webhook'), | ||
knex('task') | ||
.where('source_type', '=', 'API') | ||
.update('source_type', 'api'), | ||
]); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function(knex) { | ||
return knex.schema; | ||
}; |
File renamed without changes.
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