Change in osmo-hlr[master]: fix upgrade to version 2: imei column default value

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Thu Oct 31 03:49:58 UTC 2019


neels has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/15911/1

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 <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191031/0cde6849/attachment.htm>


More information about the gerrit-log mailing list