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>
diff --git a/openbsc/src/db.c b/openbsc/src/db.c
index ad46d98..dd74804 100644
--- a/openbsc/src/db.c
+++ b/openbsc/src/db.c
@@ -135,14 +135,12 @@
"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, "