Subterfuge-Revived / Remake-Core

Core repository that holds all game logic for both front end rendering and back end validation.
Creative Commons Zero v1.0 Universal
39 stars 24 forks source link

MongoDB Support Upgrades #114

Open QuinnBast opened 1 year ago

QuinnBast commented 1 year ago

When the MongoDB schema changes, we need to take upgrades into consideration.

There are a few scenarios:

See this document for more.

Removed members

We need to update our Mongo serializer to support extra elements and ignore extra elements for information on how to deal with the serializer exceptions on missing or extra field mappings.

Renamed

When a member has been renamed, it will exist in old documents with the old name and in new documents with the new name. The way to handle incremental upgrades for this rename would be to implement an ExtraElements member in conjunction with ISupportInitialize.

Type of member is changed

If the .NET type is compatible with the old type (an integer is changed to a double), then everything will continue to work. Otherwise, a custom serializer or a migration script will be required.

Investigate these changes, and, if possible, find a way to determine if we need to apply these in a CI pipeline so that updates get caught.