Skip to content

Commit 4143c8f

Browse files
committedDec 4, 2024
tech(api): remove unused columns in flash-algo-configurations table
1 parent 61b4b55 commit 4143c8f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const TABLE_NAME = 'flash-algorithm-configurations';
2+
const WARM_UP_LENGTH_COLUMN_NAME = 'warmUpLength';
3+
const FORCED_COMPETENCES_COLUMN_NAME = 'forcedCompetences';
4+
const MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME = 'minimumEstimatedSuccessRateRanges';
5+
const DOUBLE_MEASURES_UNTIL_COLUMN_NAME = 'doubleMeasuresUntil';
6+
const VARIATION_PERCENT_UNTIL_COLUMN_NAME = 'variationPercentUntil';
7+
8+
const up = function (knex) {
9+
return knex.schema.table(TABLE_NAME, (table) => {
10+
table.dropColumn(WARM_UP_LENGTH_COLUMN_NAME);
11+
table.dropColumn(FORCED_COMPETENCES_COLUMN_NAME);
12+
table.dropColumn(MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME);
13+
table.dropColumn(DOUBLE_MEASURES_UNTIL_COLUMN_NAME);
14+
table.dropColumn(VARIATION_PERCENT_UNTIL_COLUMN_NAME);
15+
table.comment(`Configuration parameters used to alter the behaviour of the flash algorithm.`);
16+
});
17+
};
18+
19+
const down = function (knex) {
20+
return knex.schema.table(TABLE_NAME, (table) => {
21+
table.integer(WARM_UP_LENGTH_COLUMN_NAME);
22+
table.jsonb(FORCED_COMPETENCES_COLUMN_NAME);
23+
table.jsonb(MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME);
24+
table.integer(DOUBLE_MEASURES_UNTIL_COLUMN_NAME);
25+
table.integer(VARIATION_PERCENT_UNTIL_COLUMN_NAME);
26+
});
27+
};
28+
29+
export { down, up };

0 commit comments

Comments
 (0)