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
Motivation
The macro for creating models/entities is very useful, but quite limited when it comes to declaring more complex indexes.
Some problems include:
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