Add ActiveContext migration framework
This introduces a comprehensive migration framework for Active Context and adds collection management capabilities through database-specific executors. These changes enable systematic database schema management and provide a unified way to create and manage collections across different database backends. Key changes: - Introduce migration framework with version tracking and batch operation support - Add database-specific executors for managing collections (PostgreSQL, Elasticsearch, OpenSearch) - Implement partition strategy for handling sharded collections - Move prefix configuration from Client to Adapter level - Add migrations path configuration support Technical details: - Add Migration base class with versioning support (V1_0) - Implement BatchOperationResult for tracking long-running operations - Add collection creation with field type support (bigint, prefix, vector) - Add partition management with naming strategy - Add support for creating indices on fields based on database capabilities - Implement database-specific collection creation logic: * PostgreSQL: Partitioned tables with vector support * Elasticsearch: Index templates and aliases * OpenSearch: Base executor structure (implementation pending) The migration framework follows a similar pattern to ActiveRecord migrations, with timestamped migration files and version tracking. Collections can be created with specific field types and indexing options, which are translated to the appropriate database-specific implementations. Migration files should be placed in ee/db/active_context/migrate/ by default, but this path can be configured through ActiveContext::Config.
显示
- Gemfile.lock 1 个添加, 0 个删除Gemfile.lock
- Gemfile.next.checksum 1 个添加, 1 个删除Gemfile.next.checksum
- Gemfile.next.lock 2 个添加, 1 个删除Gemfile.next.lock
- ee/db/active_context/migrate/.gitkeep 0 个添加, 0 个删除ee/db/active_context/migrate/.gitkeep
- gems/gitlab-active-context/.rubocop.yml 7 个添加, 0 个删除gems/gitlab-active-context/.rubocop.yml
- gems/gitlab-active-context/Gemfile.lock 8 个添加, 0 个删除gems/gitlab-active-context/Gemfile.lock
- gems/gitlab-active-context/gitlab-active-context.gemspec 1 个添加, 0 个删除gems/gitlab-active-context/gitlab-active-context.gemspec
- gems/gitlab-active-context/lib/active_context.rb 1 个添加, 0 个删除gems/gitlab-active-context/lib/active_context.rb
- gems/gitlab-active-context/lib/active_context/config.rb 6 个添加, 2 个删除gems/gitlab-active-context/lib/active_context/config.rb
- gems/gitlab-active-context/lib/active_context/databases/collection_builder.rb 38 个添加, 0 个删除...ontext/lib/active_context/databases/collection_builder.rb
- gems/gitlab-active-context/lib/active_context/databases/concerns/adapter.rb 18 个添加, 1 个删除...-context/lib/active_context/databases/concerns/adapter.rb
- gems/gitlab-active-context/lib/active_context/databases/concerns/client.rb 0 个添加, 4 个删除...e-context/lib/active_context/databases/concerns/client.rb
- gems/gitlab-active-context/lib/active_context/databases/concerns/executor.rb 33 个添加, 0 个删除...context/lib/active_context/databases/concerns/executor.rb
- gems/gitlab-active-context/lib/active_context/databases/elasticsearch/adapter.rb 4 个添加, 0 个删除...ext/lib/active_context/databases/elasticsearch/adapter.rb
- gems/gitlab-active-context/lib/active_context/databases/elasticsearch/executor.rb 90 个添加, 0 个删除...xt/lib/active_context/databases/elasticsearch/executor.rb
- gems/gitlab-active-context/lib/active_context/databases/opensearch/adapter.rb 4 个添加, 0 个删除...ontext/lib/active_context/databases/opensearch/adapter.rb
- gems/gitlab-active-context/lib/active_context/databases/opensearch/executor.rb 11 个添加, 0 个删除...ntext/lib/active_context/databases/opensearch/executor.rb
- gems/gitlab-active-context/lib/active_context/databases/partition_strategy.rb 41 个添加, 0 个删除...ontext/lib/active_context/databases/partition_strategy.rb
- gems/gitlab-active-context/lib/active_context/databases/postgresql/adapter.rb 4 个添加, 0 个删除...ontext/lib/active_context/databases/postgresql/adapter.rb
- gems/gitlab-active-context/lib/active_context/databases/postgresql/client.rb 95 个添加, 17 个删除...context/lib/active_context/databases/postgresql/client.rb
加载中
想要评论请 注册 或 登录