Schema-syncing more complex indexes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 734
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
Motivation
The macro for creating models/entities is very useful, but quite limited when it comes to declaring more complex indexes.
Some problems include:
- there is no way to create a partial index
- there is no way to create a composite index without it being unique (unique_key)
- the order of columns inside composite indexes matters
I don't expect the macro to support more advanced use cases, but there should be a way to specify them manually. But it's problematic with entity-first approach and schema syncing - even if you create the index yourself afterwards, the index would be dropped on the next schema sync, and the index would need to be created every time from scratch.
Proposed Solutions
- don't drop index on schema sync, or add an option for it.
- add a possibility to specify custom indexes to synchronize
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named; start by locating the schema-sync logic that drops indexes. Clarify whether the project will preserve manually created indexes or synchronize declared custom indexes, including partial and ordered composite indexes. Done means the chosen behavior is implemented without recreating or dropping unsupported indexes on every sync.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100