neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/15911 )

Change subject: fix upgrade to version 2: imei column default value
......................................................................

fix upgrade to version 2: imei column default value

A subsequent commit will add a db_upgrade test, which verifies that the db
resulting from an upgrade is identical to one created from scratch in the new
version. That test currently would show a diff: an upgraded 'imei' column has
'default NULL', where a new db created in version 2 has no default value on the
imei column.

Fix the upgrade path to add an imei column without 'default NULL', so that
adding the upgrade test will result in success. The test is added in
I0961bab0e17cfde5b030576c5bc243c2b51d9dc4

Change-Id: I68a00014a3d603fcba8781470bc5285f78b538d0
---
M src/db.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/src/db.c b/src/db.c
index f3ed863..31c4ba5 100644
--- a/src/db.c
+++ b/src/db.c
@@ -299,7 +299,7 @@
 {
        sqlite3_stmt *stmt;
        int rc;
-       const char *update_stmt_sql = "ALTER TABLE subscriber ADD COLUMN imei 
VARCHAR(14) default NULL";
+       const char *update_stmt_sql = "ALTER TABLE subscriber ADD COLUMN imei 
VARCHAR(14)";
        const char *set_schema_version_sql = "PRAGMA user_version = 2";

        rc = sqlite3_prepare_v2(dbc->db, update_stmt_sql, -1, &stmt, NULL);

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/15911
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I68a00014a3d603fcba8781470bc5285f78b538d0
Gerrit-Change-Number: 15911
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-CC: fixeria <axilira...@gmail.com>
Gerrit-MessageType: merged

Reply via email to