aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/db.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-06-09 11:31:32 +0200
committerHarald Welte <laforge@gnumonks.org>2010-06-14 20:43:50 +0200
commit10bf812a6ada275c2066079a29e1f995915c9d3f (patch)
tree276fe05f3d471ffa9fe2f9fe6789143aa9d0c571 /openbsc/src/db.c
parentc614a6a199b1b1ce4ebfe26ca427370488fe8c38 (diff)
db: Use subscriber_id as primary key for AuthKeys/AuthLastTuples
It's unique and not null and we never use 'id' anyway. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'openbsc/src/db.c')
-rw-r--r--openbsc/src/db.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/openbsc/src/db.c b/openbsc/src/db.c
index ad46d98f1..dd7480467 100644
--- a/openbsc/src/db.c
+++ b/openbsc/src/db.c
@@ -135,14 +135,12 @@ static char *create_stmts[] = {
"idx INTEGER NOT NULL "
")",
"CREATE TABLE IF NOT EXISTS AuthKeys ("
- "id INTEGER PRIMARY KEY AUTOINCREMENT, "
- "subscriber_id INTEGER UNIQUE NOT NULL, "
+ "subscriber_id INTEGER PRIMARY KEY, "
"algorithm_id INTEGER NOT NULL, "
"a3a8_ki BLOB "
")",
"CREATE TABLE IF NOT EXISTS AuthLastTuples ("
- "id INTEGER PRIMARY KEY AUTOINCREMENT, "
- "subscriber_id NUMERIC UNIQUE NOT NULL, "
+ "subscriber_id INTEGER PRIMARY KEY, "
"issued TIMESTAMP NOT NULL, "
"use_count INTEGER NOT NULL DEFAULT 0, "
"key_seq INTEGER NOT NULL, "