<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><ul><li>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.</li></ul></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I agree. For now I have kept the upgrade in C strings.<br>If we are otherwise happy with this time, I'll invest the extra time and store upgrade staments in separate SQL files.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">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)</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I think the currently proposed schema update is rather trivial,<br>but sure, we can add tests. I'd rather get the core of the change<br>merged first, though. Manual testing has already been performed.</p><p><a href="https://gerrit.osmocom.org/11898">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11898">change 11898</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11898"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I8aeaa9a404b622657cbc7138106f38aa6ad8d01b </div>
<div style="display:none"> Gerrit-Change-Number: 11898 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 27 Nov 2018 14:47:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>