From 5291aebd08baf9cf5339bd3560a107b6db1cac0e Mon Sep 17 00:00:00 2001 From: eecavanna <134325062+eecavanna@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:03:12 -0700 Subject: [PATCH 1/2] Create 0007-mongo-migration-scripts.md --- decisions/0007-mongo-migration-scripts.md | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 decisions/0007-mongo-migration-scripts.md diff --git a/decisions/0007-mongo-migration-scripts.md b/decisions/0007-mongo-migration-scripts.md new file mode 100644 index 0000000..71a4172 --- /dev/null +++ b/decisions/0007-mongo-migration-scripts.md @@ -0,0 +1,25 @@ +--- +status: accepted +date: 2023-08-01 +deciders: @eecavanna, @Shalsh23, @shreddd, @turbomam, @dwinston +consulted: +informed: All existing `nmdc-schema` and `nmdc-runtime` contributors +--- +# Mongo schema changes will always be accompanied by data migration scripts + +## Context and Problem Statement + +The Mongo database used by the NMDC contains data that adheres to the specific version of `nmdc-schema` being imported by `nmdc-runtime`. Over time, new versions of `nmdc-schema` are imported into `nmdc-runtime`. + +Currently, when a new version of `nmdc-schema` is imported into `nmdc-runtime`, the maintainers of `nmdc-runtime` do not always know whether any changes to existing data will be required in order to make it so that the existing data adheres to the new version of `nmdc-schema`; and, if so, what those changes are. + +## Considered Options + +1. An `nmdc-schema` maintainer and an `nmdc-runtime` maintainer discuss each new version of `nmdc-schema` before it gets imported into `nmdc-runtime` +2. An `nmdc-schema` maintainer commits a data migration script (which may be a no-op) in the `nmdc-schema` repository along with each unit of schema changes + +## Decision Outcome + +Chosen option: "An `nmdc-schema` maintainer commits a data migration script (which may be a no-op) in the `nmdc-schema` repository along with each unit of schema changes" + +This was chosen because it will make it so the data changes (or lack thereof) are explicitly documented, in a standard format and location, and can (eventually) be performed by a CI system. From fce228fdd7737be879cd1e42341cb0ddd8f81a90 Mon Sep 17 00:00:00 2001 From: eecavanna <134325062+eecavanna@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:19:56 -0700 Subject: [PATCH 2/2] Populate `consulted` field based upon feedback --- decisions/0007-mongo-migration-scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decisions/0007-mongo-migration-scripts.md b/decisions/0007-mongo-migration-scripts.md index 71a4172..918f9f4 100644 --- a/decisions/0007-mongo-migration-scripts.md +++ b/decisions/0007-mongo-migration-scripts.md @@ -2,7 +2,7 @@ status: accepted date: 2023-08-01 deciders: @eecavanna, @Shalsh23, @shreddd, @turbomam, @dwinston -consulted: +consulted: (same as `deciders`) informed: All existing `nmdc-schema` and `nmdc-runtime` contributors --- # Mongo schema changes will always be accompanied by data migration scripts