Determine whether or not we need to refactor how the liquibase changelog .yml files are structured due to current difficulty with changes to FK constrained items.
Timebox
Time allocated (2 FTE days)
Notes
As part of #1404 it was determined that changing the variable names "sentSubmissionId" and "receivedSubmissionId" to "inboundMessageId" and "outboundMessageId" required a corresponding change to the metadata table column names referencing those items. Relevant column names are "received_message_id" and "sent_message_id" created in changeSet 2 of metadata.yml
The message_link table has a column named" message_id" which references column "received_message_Id" of the metadata table. This column would also have to be changed if the metadata column names are changed.
In order to change the column name in the message link table we would need to first drop the message_link constraint on the metadata table, then change the column names on the metadata table, then change the referenced column name in the message_link table an re-add the constraint.
-The above is difficult to accomplish with our current changelog structure as we would have to change the convention we are using in order to apply the migrations in the correct order (ex: we would need to add a changeset that changed the message_link table in the metadata.yml file). This would then make applying the same migrations to a new clean database not work correctly.
Spike Goal
Determine whether or not we need to refactor how the liquibase changelog .yml files are structured due to current difficulty with changes to FK constrained items.
Timebox
Time allocated (2 FTE days)
Notes
As part of #1404 it was determined that changing the variable names "sentSubmissionId" and "receivedSubmissionId" to "inboundMessageId" and "outboundMessageId" required a corresponding change to the metadata table column names referencing those items. Relevant column names are "received_message_id" and "sent_message_id" created in changeSet 2 of metadata.yml
The message_link table has a column named" message_id" which references column "received_message_Id" of the metadata table. This column would also have to be changed if the metadata column names are changed.
In order to change the column name in the message link table we would need to first drop the message_link constraint on the metadata table, then change the column names on the metadata table, then change the referenced column name in the message_link table an re-add the constraint.
-The above is difficult to accomplish with our current changelog structure as we would have to change the convention we are using in order to apply the migrations in the correct order (ex: we would need to add a changeset that changed the message_link table in the metadata.yml file). This would then make applying the same migrations to a new clean database not work correctly.
-Options: 1.) remove the message link table entirely as proposed in #1422 2.) Completely refactor the migrations to follow the Liquibase release-oriented structure https://docs.liquibase.com/start/design-liquibase-project.html