Prepare workspace for search features at creation (#7467)

Enabling feature flags IsSearchEnabled and IsWorkspaceMigratedForSearch
at workspace creation to ensure workspaces have the searchVector fields
and indexes created.
For the feature to be enabled in the front-end we will also need
IsQueryRunnerTwentyORMEnabled to be enabled but that is an independent
topic.
This commit is contained in:
Marie
2024-10-07 15:29:33 +02:00
committed by GitHub
parent 7bdbbcf72e
commit 94031605ac
6 changed files with 53 additions and 8 deletions

View File

@ -46,4 +46,17 @@ export class FeatureFlagService {
return workspaceFeatureFlagsMap;
}
public async enableFeatureFlags(
keys: FeatureFlagKey[],
workspaceId: string,
): Promise<void> {
await this.featureFlagRepository.upsert(
keys.map((key) => ({ workspaceId, key, value: true })),
{
conflictPaths: ['workspaceId', 'key'],
skipUpdateIfNoValuesChanged: true,
},
);
}
}