Create migration using npm run migrate:make add-feature-flag-my-new-feature:
import type { Knex } from 'knex';
import {
createFeatureFlagWithDescriptionAndTeam,
rollbackCreateFeatureFlag,
} from '@commons/backend/models/migrations/helpers/feature-flag-helpers';
const FEATURE_FLAG_NAME = 'myNewFeatureFlag';
export async function up(knex: Knex): Promise<number[]> {
return createFeatureFlagWithDescriptionAndTeam(
FEATURE_FLAG_NAME,
knex,
'Brief description of what this flag controls',
'Team Name',
);
}
export async function down(knex: Knex): Promise<number> {
return rollbackCreateFeatureFlag(FEATURE_FLAG_NAME, knex);
}