feat (search): add dynamic search field metadata foundation for database-driven search configuration (#14469)
## Summary Implements the foundation for dynamic search field configuration from [issue #1428](https://github.com/twentyhq/core-team-issues/issues/1428). ## Changes - Add `SearchFieldMetadataEntity` junction table for storing searchable field configurations - Add `SearchFieldMetadataService` with core CRUD operations - Add `SearchFieldMetadataModule` following existing patterns - Add `IS_DYNAMIC_SEARCH_FIELDS_ENABLED` feature flag (defaults to `false`) - Database migration with proper indexes and foreign keys ## Architecture Uses a junction table where **record existence = field is searchable**: **Table: `searchFieldMetadata(objectMetadataId, fieldMetadataId, workspaceId)`** - Unique constraint on `(objectMetadataId, fieldMetadataId)` - `ON DELETE CASCADE` on foreign keys ## Testing - [x] Migration runs successfully - [x] Table created with correct schema - [x] Feature flag seeded properly - [x] Database reset works correctly ## Next Steps Future PRs will handle: - Data migration from existing hardcoded search field configs - Integration with search services ✅ No breaking changes — fully backward compatible.
This commit is contained in:
+1
@@ -18,4 +18,5 @@ export enum FeatureFlagKey {
|
||||
IS_CALENDAR_VIEW_ENABLED = 'IS_CALENDAR_VIEW_ENABLED',
|
||||
IS_GROUP_BY_ENABLED = 'IS_GROUP_BY_ENABLED',
|
||||
IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED',
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED = 'IS_DYNAMIC_SEARCH_FIELDS_ENABLED',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user