Change in osmo-hlr[master]: add database schema versioning to the HLR database

Stefan Sperling gerrit-no-reply at
Tue Nov 27 14:47:29 UTC 2018

Stefan Sperling has posted comments on this change. ( )

Change subject: add database schema versioning to the HLR database

Patch Set 5:

> - If needed, run upgrade commands. I think I would put them in a separate .sql file and make a string array of it, exactly like db_bootstrap.h is generated from hlr.sql; e.g. upgrade_0_to_1.sql generates upgrade_0_to_1.h? We'd probably rename db_bootstrap.sed to sql_to_c.sed and re-use. I mean, it's ok to do the upgrade with SQL strings directly in C, but so far we're keeping the SQL strings apart from C pretty nicely, and it's less cluttered to write SQL in a separate file without C quotes.

I agree. For now I have kept the upgrade in C strings.
If we are otherwise happy with this time, I'll invest the extra time and store upgrade staments in separate SQL files.

> To test the upgrade code path, we should probably add a tests/upgrade/ with a hlr_v0.sql that also adds some data, and write an explicit test (.sh?) to invoke 'osmo-hlr --db-allow-upgrade' and verify the result (`sqlite3 db .dump`?). (maybe useful for that would be a '--check-db-and-exit' option as well)

I think the currently proposed schema update is rather trivial,
but sure, we can add tests. I'd rather get the core of the change
merged first, though. Manual testing has already been performed.

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8aeaa9a404b622657cbc7138106f38aa6ad8d01b
Gerrit-Change-Number: 11898
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling <ssperling at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at>
Gerrit-Reviewer: Stefan Sperling <ssperling at>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
Gerrit-Comment-Date: Tue, 27 Nov 2018 14:47:29 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list