Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TECH] Suppression des paramètres non utilisés de l'algo flash (PIX-15475). #10678

Prev Previous commit
tech(api): remove unused columns in flash-algo-configurations table
  • Loading branch information
alexandrecoin committed Dec 4, 2024
commit 4143c8f84f99a31411e9330e58490bc9be2c85fc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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);
table.comment(`Configuration parameters used to alter the behaviour of the flash algorithm.`);
});
};

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 };
Loading