I’m experiencing a serious issue with my MongoDB indexes getting overwritten while trying to integrate the new Schema Migration feature:
parse-community:alpha
← GoPlan-Finance:pr-migrations
opened 02:43AM - 06 Jun 21 UTC
### New Pull Request Checklist
<!--
Please check the following boxes [x] b… efore submitting your issue.
Click the "Preview" tab for better readability.
Thanks for contributing to Parse Server!
-->
### Continuation of PR #7091 from @Moumouls
- [x] I am not disclosing a [vulnerability](https://github.com/parse-community/parse-server/blob/master/SECURITY.md).
- [x] I am creating this PR in reference to an [issue](https://github.com/parse-community/parse-server/issues?q=is%3Aissue).
### Issue Description
Related issue: #7063
### Approach
Provide an easy way to add and handle schema updates and migrations for Parse-Server.
## Examples:
How to use it in for Parse-server initialization :
https://github.com/sadortun/GoPlan-app/blob/feat-holding-history/backend/src/server.ts#L73
How to define your schemas :
https://github.com/sadortun/GoPlan-app/tree/feat-holding-history/backend/src/Migrations/schemas
### TODOs before merging
<!--
Add TODOs that need to be completed before merging this PR.
Delete suggested TODOs that do not apply to this PR.
-->
- [x] Add better logging/error managment
....
- [x] Add test cases
- [x] Add entry to changelog
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
I understand that unique indexes are not supported yet, so I defined all of my indexes using MongoAltas including some unique and partial indexes as required.
However, when adding the schema
option in my ParseServer
class, all of those indexes are being overwritten and reset, even though my individual schemas do not include the indexes
key, like so:
export const TestSchema = {
className: 'Test',
fields: {
user: { type: 'Pointer', targetClass: '_User' },
date: { type: 'String' },
size: { type: 'Number' }
},
classLevelPermissions: {
find: { pointerFields: ['user'] },
count: { pointerFields: ['user'] },
get: { pointerFields: ['user'] },
update: { pointerFields: ['user'] },
delete: { pointerFields: ['user'] },
create: {}
}
}
Is there a way where I can keep my cloud schema’s indexes intact while also using the schema migration feature?
Thanks in advance.
me too, but no one answer