[SHOP-32] Solve the dbmigration script conflict when the commenting module is installed Created: 05/Jun/20  Updated: 30/Mar/21  Resolved: 30/Mar/21

Status: Closed
Project: Shop
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Neutral
Reporter: Adrien Manzoni Assignee: Riste Drangovski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[X]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Core

 Description   

When the module is installed with the commenting module, there is a conflict of db migration script between the commenting and the shop module



 Comments   
Comment by Riste Drangovski [ 06/Jun/20 ]

Hi @amanzoni,
I pushed a fix for this issue on develop branch:
https://git.magnolia-cms.com/projects/INCUBATOR/repos/shop/commits/4fa178df4bf8a61edf71284deb6fefabf4237f68
and I also created a new branch for commenting module with the same logic as in the shop module:
https://git.magnolia-cms.com/projects/INCUBATOR/repos/commenting/commits/d51fb0d4d12947e9b0ce2a5eb9991b4ae09e45d7

DB Migration/Init scripts for both modules were saved on same relative path ( ex. "dbmigration/mysql" ), so ebean's resource loader was loading wrong scripts for the second module.

The easiest way to fix this issue was to prefix the resource relative paths with module name so with this changes, shop-core module scripts are located at "shop-core/dbmigraion/mysql" and commenting-core scripts are located at "commenting-core/dbmigration/mysql" and ebean's resource loader loads right scripts for each module.

Please let me know if something needs improvements.

Regards,
Riste

Generated at Mon Feb 12 10:48:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.