You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With migrations now supported there are multiple places where we keep references to the current models. They are updated at different times and in different places. This has led to entangling of some dependencies on other services.
This should be refactored to simplify the code and reduce chances of bugs.
There are currently 3 places where the current models/schema are needed:
StoreCacheService to provide CachedModels in the store
StoreService sequelize hooks to use the right block height when querying/updating data
StoreService _modelIndexedFields and _modelsRelations for POI and store methods
Solution
When a migration is run it should return all the required information (sequelize models, gql schema) to update the necessary places. This should remove the need for the SchemaMigraionService and Migration to depend on the StoreService.
There should be a new method on the StoreService that is called after a migration that updates everything correctly and this should be the only way to set fields that depend on the current models/schema
The text was updated successfully, but these errors were encountered:
Description
With migrations now supported there are multiple places where we keep references to the current models. They are updated at different times and in different places. This has led to entangling of some dependencies on other services.
This should be refactored to simplify the code and reduce chances of bugs.
There are currently 3 places where the current models/schema are needed:
_modelIndexedFields
and_modelsRelations
for POI and store methodsSolution
When a migration is run it should return all the required information (sequelize models, gql schema) to update the necessary places. This should remove the need for the SchemaMigraionService and Migration to depend on the StoreService.
There should be a new method on the StoreService that is called after a migration that updates everything correctly and this should be the only way to set fields that depend on the current models/schema
The text was updated successfully, but these errors were encountered: