Multiple indexes, multi column indexes #27
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As long as commit #26 allows you to create other Indexes aside Primary Key it doesn't allows you to create multiple indexes and indexes over multiple columns.
Multiple indexes:
old behavior (bug?):
Because of
find()
inmodel.ts
found on row 46 only one column can be unique (or have a same index). Another definitions will be ignored.new behavior
Every defined index will be used. It uses
filter()
and is iterating through the whole array of indexes instead of taking only first index.Multicolumn indexes
You can create separate index for multiple columns.
For example: If you want to create unique combination of username and email, you can define it in your model:
Common improvments
Index
IndexType
columnIndexesList