diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-05-03 18:47:08 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-05-03 18:48:12 +0200 |
commit | b565a56607e7006bf2ce843611bc3d32c8c651dc (patch) | |
tree | e904b30cc8c80a8eed1ad8b542d7c432bee975c6 | |
parent | 7fc5dcc49f56fedf70a04b5cf989de7cd1d367c9 (diff) |
hlr.sql: Don't use TRUE/FALSE as DEFAULT, they will be strings :(
SQLite has this crappy type system where you can put a string into
a boolean or integer column, which of course will break once you try to
read it as bool..
Also, add an index by IMSI to the SUBSCRIBER table.
-rw-r--r-- | osmo-gsup-hlr/sql/hlr.sql | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/osmo-gsup-hlr/sql/hlr.sql b/osmo-gsup-hlr/sql/hlr.sql index b95d260..9b8156e 100644 --- a/osmo-gsup-hlr/sql/hlr.sql +++ b/osmo-gsup-hlr/sql/hlr.sql @@ -27,15 +27,15 @@ CREATE TABLE subscriber ( -- Chapter 2.13.115 periodic_rau_tau_tmr INTEGER, -- Chapter 2.1.1.2: network access mode - nam_cs BOOLEAN NOT NULL DEFAULT TRUE, - nam_ps BOOLEAN NOT NULL DEFAULT TRUE, + nam_cs BOOLEAN NOT NULL DEFAULT 1, + nam_ps BOOLEAN NOT NULL DEFAULT 1, -- Chapter 2.1.8 lmsi INTEGER, -- Chapter 2.7.5 - ms_purged_cs BOOLEAN NOT NULL DEFAULT FALSE, + ms_purged_cs BOOLEAN NOT NULL DEFAULT 0, -- Chapter 2.7.6 - ms_purged_ps BOOLEAN NOT NULL DEFAULT FALSE + ms_purged_ps BOOLEAN NOT NULL DEFAULT 0 ); CREATE TABLE subscriber_apn ( @@ -64,4 +64,5 @@ CREATE TABLE auc_3g ( sqn INTEGER ); +CREATE UNIQUE INDEX IF NOT EXISTS idx_subscr_imsi ON subscriber (imsi); -- SELECT algo_id_2g, ki, algo_id_3g, k, op, opc, sqn FROM subscriber LEFT JOIN auc_2g ON auc_2g.subscriber_id = subscriber.id LEFT JOIN auc_3g ON auc_3g.subscriber_id = subscriber.id WHERE imsi = ? |