From 10bf812a6ada275c2066079a29e1f995915c9d3f Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Wed, 9 Jun 2010 11:31:32 +0200 Subject: [PATCH] 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 --- openbsc/src/db.c | 6 ++---- 1 file 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, "