open-reaction-database / ord-schema

Schema for the Open Reaction Database
https://open-reaction-database.org
Apache License 2.0
93 stars 26 forks source link

Guidance on updating an ORD database from a (much) earlier version #742

Open bdeadman opened 1 month ago

bdeadman commented 1 month ago

Is your feature request related to a problem? Please describe. If an organisation has been using a very early version of the ORD to store their internal data, there may be challenges in updating the ord-schema to later versions.

Describe the solution you'd like Some documentation to outline the process. Where version changes are found to change the ORM and how it functions, or deprecate certain fields or ENUMs then advice can be provided on how to migrate old data through the change.

bdeadman commented 1 month ago

0.3.37 -> 0.3.38 ord_schema.orm.mappers overhauled to use programmatic ORM definitions instead of explicitly defined classes. After this change it is no longer possible to use:

from ord_schema.orm.mappers import Compound, CompoundIdentifier, Reaction, ReactionInput

skearnes commented 1 month ago

You need to change your imports to use the Mappers object: https://github.com/open-reaction-database/ord-schema/blob/main/ord_schema/orm/rdkit_mappers_test.py#L29

bdeadman commented 1 month ago

0.3.37 -> 0.3.38 NAME ReactionIdentifierType ENUM changed to REACTION_TYPE.