Bhavya-Sonigra opened a new pull request, #6302:
URL: https://github.com/apache/fineract/pull/6302

   FINERACT-2704: Re-baseline database migrations for 1.15.0
   
   ### Description
   This PR implements 
[FINERACT-2704](https://issues.apache.org/jira/browse/FINERACT-2704), 
re-baselining the Fineract Liquibase database migrations as of the 1.15.0 
release to drastically improve the speed of fresh database initializations 
(e.g., `./gradlew devRun`).
   
   **Background:**
   Starting a fresh database from scratch was becoming progressively slower 
because of the sheer volume of historical Liquibase migrations that needed to 
be executed in sequence. By re-baselining, we create a clean, consolidated 
starting point representing the 1.15.0 schema and data, allowing us to drop all 
historical pre-1.15.0 migrations while keeping any newer post-1.15.0 migrations 
intact. 
   
   **Changes Made:**
   * Generated a consolidated `0001_initial_schema.sql` (DDL) and 
`0002_initial_data.sql` (DML) representing the 1.15.0 database state.
   * Cleaned up the initial data dump by converting 283 `pg_dump` `COPY ... 
FROM STDIN` blocks into 2,235 standard `INSERT INTO` statements to ensure 
compatibility with Liquibase JDBC execution.
   * Appended 38 `setval()` sequence resets (including Spring Batch 
`BATCH_*_SEQ` tables) to the initial data script to ensure auto-incrementing 
sequences resume at the correct high-water mark, preventing primary key 
collisions for subsequent migrations.
   * Stripped `pg_dump` specific headers and configured 
`splitStatements="true"` for the initial data XML wrapper to allow Liquibase to 
process the inserts efficiently.
   * Deleted all obsolete pre-1.15.0 migration files across `fineract-provider` 
and all submodules (`savings`, `loan`, `working-capital-loan`, etc.).
   * Renumbered all remaining post-1.15.0 migrations to execute sequentially 
after the baseline (e.g., `0003`, `0004`) and updated all 
`changelog-tenant.xml` and `module-changelog-master.xml` files to reflect the 
new sequence.
   * Verified end-to-end functionality by successfully running `./gradlew 
devRun` on a fresh database, which successfully bootstrapped the server in ~45 
seconds, and validated that the unit test suite passes cleanly.
   
   ---
   
   ### Checklist
   Please make sure these boxes are checked before submitting your pull request 
- thanks!
   
   - [x] Write the commit message as per our guidelines
   - [x] Acknowledge that we will not review PRs that are not passing the build 
("green") - it is your responsibility to get a proposed PR to pass the build, 
not primarily the project's maintainers.
   - [x] Create/update unit or integration tests for verifying the changes made.
   - [x] Follow our coding conventions.
   - [ ] Add required Swagger annotation and update API documentation at 
`fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm` with 
details of any API changes
   - [x] This PR must not be a "code dump". Large changes can be made in a 
branch, with assistance. Ask for help on the developer mailing list.
   - [x] If merging this PR resolves a JIRA issue, I will mark that issue as 
resolved and set "Fix Version/s" appropriately.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to