diff --git a/src/lib/db/feature-environment-store.ts b/src/lib/db/feature-environment-store.ts index 9f2754e6d6..6b3cb73925 100644 --- a/src/lib/db/feature-environment-store.ts +++ b/src/lib/db/feature-environment-store.ts @@ -303,41 +303,6 @@ export class FeatureEnvironmentStore implements IFeatureEnvironmentStore { .del(); } - // TODO: remove this once variants per env are GA - async clonePreviousVariants( - environment: string, - project: string, - ): Promise { - const rows = await this.db(`${T.features} as f`) - .select([ - this.db.raw(`'${environment}' as environment`), - 'fe.enabled', - 'fe.feature_name', - 'fe.variants', - ]) - .distinctOn(['environment', 'feature_name']) - .join(`${T.featureEnvs} as fe`, 'f.name', 'fe.feature_name') - .whereNot({ environment }) - .andWhere({ project }); - - const newRows = rows.map((row) => { - const r = row as any as IFeatureEnvironmentRow; - return { - variants: JSON.stringify(r.variants), - enabled: r.enabled, - environment: r.environment, - feature_name: r.feature_name, - }; - }); - - if (newRows.length > 0) { - await this.db(T.featureEnvs) - .insert(newRows) - .onConflict(['environment', 'feature_name']) - .merge(['variants']); - } - } - async connectFeatureToEnvironmentsForProject( featureName: string, projectId: string, diff --git a/src/lib/types/stores/feature-environment-store.ts b/src/lib/types/stores/feature-environment-store.ts index cc11d1830f..ac2c11ff51 100644 --- a/src/lib/types/stores/feature-environment-store.ts +++ b/src/lib/types/stores/feature-environment-store.ts @@ -85,7 +85,5 @@ export interface IFeatureEnvironmentStore featureEnvironment: IFeatureEnvironment, ): Promise; - clonePreviousVariants(environment: string, project: string): Promise; - variantExists(featureName: string): Promise; } diff --git a/src/test/fixtures/fake-feature-environment-store.ts b/src/test/fixtures/fake-feature-environment-store.ts index 92c06633a6..92f417c42e 100644 --- a/src/test/fixtures/fake-feature-environment-store.ts +++ b/src/test/fixtures/fake-feature-environment-store.ts @@ -224,15 +224,6 @@ export default class FakeFeatureEnvironmentStore throw new Error('Method not implemented.'); } - clonePreviousVariants( - // eslint-disable-next-line @typescript-eslint/no-unused-vars - environment: string, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - project: string, - ): Promise { - throw new Error('Method not implemented.'); - } - async getAllByFeatures( // eslint-disable-next-line @typescript-eslint/no-unused-vars features: string[],