Conversation
…s & add fields option
refactor(authorization): add default index names fix(database): import/export checks & ignore indexes of other db type
kkopanidis
requested changes
Aug 6, 2024
Contributor
kkopanidis
left a comment
There was a problem hiding this comment.
Generally looks good. One needed addition, is to create some index compatibility wherever possible. For example mongo ascending and descending index can be converted to the SQL equivalent.
Contributor
|
Perhaps it makes sense to have a set of compatible indexes with a distinct type, so that when we use them in platform models we know they are going to be OK in all deployments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This PR adds the full index support that was missing for MySQL, MariaDB and SQLite
Breaking changes:
'PostgreSQL', but the sequelize dialect string'postgres'typesfield in sequelize now has the type of Array like in mongoose (even though sequelize requires only one index type and not one for each index field like in mongoose)nameis now a required field for indexes, as it ensures uniquenessFixes:
A few mongo indexes where added in some authz schemas (ActorIndex, ObjectIndex, Permission, Relationship) while this PR wasn't merged yet, so I had to add the default names mongoose assigns to indexes without a specified name. Meanwhile, I had to add some logic in schema converters to ignore indexes of another DB type, so that these indexes wouldn't cause an issue in case of using conduit with another DB like SQL
Bugs associated with indexes not being stored inside schema (field indexes + modelOptions indexes) when using the endpoints for index creation/deletion
indexeskey missing invalidateModelOptions()not allowing schemas that contain modelOptions indexes to be patchedRefactoring:
Additions:
Notes:
Reference: Duplicated unique constraints and indexes on sequelize.sync({ alter: true }) sequelize/sequelize#12889
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
mainbranchfix #xxx, where "xxx" is the issue number)If adding a new feature, the PR's description includes: