<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-hlr/+/15911">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix upgrade to version 2: imei column default value<br><br>A subsequent commit will add a db_upgrade test, which verifies that the db<br>resulting from an upgrade is identical to one created from scratch in the new<br>version. That test currently would show a diff: an upgraded 'imei' column has<br>'default NULL', where a new db created in version 2 has no default value on the<br>imei column.<br><br>Fix the upgrade path to add an imei column without 'default NULL', so that<br>adding the upgrade test will result in success. The test is added in<br>I0961bab0e17cfde5b030576c5bc243c2b51d9dc4<br><br>Change-Id: I68a00014a3d603fcba8781470bc5285f78b538d0<br>---<br>M src/db.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/15911/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/db.c b/src/db.c</span><br><span>index f3ed863..31c4ba5 100644</span><br><span>--- a/src/db.c</span><br><span>+++ b/src/db.c</span><br><span>@@ -299,7 +299,7 @@</span><br><span> {</span><br><span>       sqlite3_stmt *stmt;</span><br><span>  int rc;</span><br><span style="color: hsl(0, 100%, 40%);">- const char *update_stmt_sql = "ALTER TABLE subscriber ADD COLUMN imei VARCHAR(14) default NULL";</span><br><span style="color: hsl(120, 100%, 40%);">+    const char *update_stmt_sql = "ALTER TABLE subscriber ADD COLUMN imei VARCHAR(14)";</span><br><span>        const char *set_schema_version_sql = "PRAGMA user_version = 2";</span><br><span> </span><br><span>        rc = sqlite3_prepare_v2(dbc->db, update_stmt_sql, -1, &stmt, NULL);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hlr/+/15911">change 15911</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/c/osmo-hlr/+/15911"/><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-Change-Id: I68a00014a3d603fcba8781470bc5285f78b538d0 </div>
<div style="display:none"> Gerrit-Change-Number: 15911 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>