mojaloop / project

Repo to track product development issues for the Mojaloop project.
Other
22 stars 15 forks source link

Central Ledger Migration / Seeds implementation should not depend on the auto_increment config of mysql #3939

Open vijayg10 opened 3 weeks ago

vijayg10 commented 3 weeks ago

Goal:

As a <stakeholder|persona>

I want to seed the database tables with fixed Enum integer values instead of depending on the auto increment of mysql

so that I can deploy mysql with any auto_increment value which will be needed incase of active-active replica and cluster deployments

Problem: The seeding mechanism in the central ledger is poorly implemented and highly depends on the auto increment config of mysql.

For example in this file there are no fixed values specified for settlementGranularityTypes. and it is expecting that two records will be created with GROSS with id value '1' and NET with id value as '2'. But if the auto increment is set to 3 instead of 1, then record 'NET' will be created with the id values as '4'. So it will not match with the Enum mappings here

Acceptance Criteria:

Complexity: <High|Medium|Low> > A short comment to remind the reason for the rating

Uncertainty: <High|Medium|Low> > A short comment to remind the reason for the rating


Tasks:

Done

Pull Requests:

Follow-up:

Dependencies:

Accountability:

vijayg10 commented 3 weeks ago

@kalinkrustev suggested this ref https://github.com/knex/knex/issues/2130