-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(database)!: add index support for all sql dialects & index refactoring #643
base: main
Are you sure you want to change the base?
Conversation
…s & add fields option
refactor(authorization): add default index names fix(database): import/export checks & ignore indexes of other db type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 PR adds the full index support that was missing for MySQL, MariaDB and SQLite
Breaking changes:
'PostgreSQL'
, but the sequelize dialect string'postgres'
types
field 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)name
is 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
indexes
key 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:
main
branchfix #xxx
, where "xxx" is the issue number)If adding a new feature, the PR's description includes: