diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-10-31 04:26:18 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2019-10-31 04:48:39 +0100 |
commit | a9f8a4bdcec084d9ed4593a2e435687a14a128f3 (patch) | |
tree | 5423260dfc588006c97ae00184081654dcf6ca22 | |
parent | f5459de2e2763ce13b7bb2360fb265cbe7239342 (diff) |
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
-rw-r--r-- | src/db.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -299,7 +299,7 @@ static int db_upgrade_v2(struct db_context *dbc) { 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); |