[PATCH] osmo-hlr[master]: sql: add unique constraints to IMSI and MSISDN

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Feb 1 16:10:28 UTC 2017


Review at  https://gerrit.osmocom.org/1722

sql: add unique constraints to IMSI and MSISDN

Todo for later: table subscriber_multi_msisdn possibly allows duplicating the
MSISDN, so we should drop this table or have all MSISDNs in one table separate
from 'subscriber'.

Change-Id: I5737106a232e416d67a10634e6270a7a89cf1b05
---
M sql/hlr.sql
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/sql/hlr.sql b/sql/hlr.sql
index 5a02be3..9238871 100644
--- a/sql/hlr.sql
+++ b/sql/hlr.sql
@@ -3,9 +3,9 @@
 CREATE TABLE subscriber (
 	id		INTEGER PRIMARY KEY,
 	-- Chapter 2.1.1.1
-	imsi		VARCHAR(15) NOT NULL,
+	imsi		VARCHAR(15) UNIQUE NOT NULL,
 	-- Chapter 2.1.2
-	msisdn		VARCHAR(15),
+	msisdn		VARCHAR(15) UNIQUE,
 	-- Chapter 2.2.3: Most recent / current IMEI
 	imeisv		VARCHAR,
 	-- Chapter 2.4.5

-- 
To view, visit https://gerrit.osmocom.org/1722
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5737106a232e416d67a10634e6270a7a89cf1b05
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list