-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tech(api): remove unused columns in flash-algo-configurations table
- Loading branch information
1 parent
61b4b55
commit e82c8f9
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...igrations/20241128152506_remove-unused-columns-in-flash-algorithm-configurations-table.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,28 @@ | ||
const TABLE_NAME = 'flash-algorithm-configurations'; | ||
const WARM_UP_LENGTH_COLUMN_NAME = 'warmUpLength'; | ||
const FORCED_COMPETENCES_COLUMN_NAME = 'forcedCompetences'; | ||
const MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME = 'minimumEstimatedSuccessRateRanges'; | ||
const DOUBLE_MEASURES_UNTIL_COLUMN_NAME = 'doubleMeasuresUntil'; | ||
const VARIATION_PERCENT_UNTIL_COLUMN_NAME = 'variationPercentUntil'; | ||
|
||
const up = function (knex) { | ||
return knex.schema.table(TABLE_NAME, (table) => { | ||
table.dropColumn(WARM_UP_LENGTH_COLUMN_NAME); | ||
table.dropColumn(FORCED_COMPETENCES_COLUMN_NAME); | ||
table.dropColumn(MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME); | ||
table.dropColumn(DOUBLE_MEASURES_UNTIL_COLUMN_NAME); | ||
table.dropColumn(VARIATION_PERCENT_UNTIL_COLUMN_NAME); | ||
}); | ||
}; | ||
|
||
const down = function (knex) { | ||
return knex.schema.table(TABLE_NAME, (table) => { | ||
table.integer(WARM_UP_LENGTH_COLUMN_NAME); | ||
table.jsonb(FORCED_COMPETENCES_COLUMN_NAME); | ||
table.jsonb(MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME); | ||
table.integer(DOUBLE_MEASURES_UNTIL_COLUMN_NAME); | ||
table.integer(VARIATION_PERCENT_UNTIL_COLUMN_NAME); | ||
}); | ||
}; | ||
|
||
export { down, up }; |