Repository navigation
1.3.0: one database definition for installs, upgrades, and tests #127
Copy link
Copy link
Open
Feature
0 / 100 of 10 issues completed
Copy link
Labels
enhancementNew feature or requestNew feature or requestplannedActive backlog; exempt from stale botActive backlog; exempt from stale bot
Description
In short
In 1.3.0, one database changelog inside the backend defines every SITMUN database: fresh installs, upgrades from 1.2.9, and backend tests. Today five copies exist and they disagree, so fixes reach some installs and not others.
What is wrong today
- Five copies of the database definition (backend, backend tests, PostgreSQL, Oracle, development) hold 72, 73, 111, 111, and 111 code list rows. 57 shared rows have different IDs.
- Translations are linked by ID, so some point at the wrong row or at none.
- The backend adds 44 code lists and every JDBC driver at startup from
application.yml. On Oracle in CI those inserts were rolled back while the backend reported itself ready. - Production schemas differ from what the code expects (Widen production columns that are narrower than the Hibernate mapping #92, Align production nullability with the Hibernate mapping #93, Add the Hibernate unique constraint on STM_GEOINFO.GEO_STYID #94, Store service-check timestamps with a time zone #95, Confirm production-only constraints that Hibernate does not declare #96) and offer service types the platform cannot run (Restrict service.type to WMS, WFS, and WMTS on every profile #101).
- Backend tests use their own copy, so they pass while installs fail.
- Changing languages or default language means regenerating files with scripts in
tools/that are hard to keep up to date.
Plan
| Step | Issue |
|---|---|
| One baseline changelog in the backend | #123 |
| Upgrade a 1.2.9 database on first start, plus an upgrade guide | #124 |
| Stop writing code lists at startup | #125 |
| CI checks that stop drift | #126 |
The baseline also closes #92, #93, #94, #95, #96, and #101.
Decisions
- Upgrades start from 1.2.9 only. Older installs move to 1.2.9 first.
- The upgrade runs by itself when 1.3.0 starts. It stops with a clear message if the database is not at 1.2.9.
- No 1.2.x patch. The Oracle service-check fix (sitmun-admin-app#516) ships in 1.3.0.
- Languages belong to each deployment. The baseline ships five with English as default. Deployments switch the default with
/api/language-default/change, disable languages they do not want, and add their own. - JDBC drivers are code list values an admin can add or delete. They are not set in
application.yml.
Order
After the monorepo move (#105), so one pull request can change the backend, the profiles, and CI together. Pull requests sitmun-backend-core#355 and #122 are closed or rescoped before the move, because the baseline replaces their database changes.
Work that touches no repository can start now: generating the schema from a 1.2.9 database and trying the upgrade SQL on H2, PostgreSQL, and Oracle.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestplannedActive backlog; exempt from stale botActive backlog; exempt from stale bot
Activity