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>
This commit is contained in:
Sylvain Munaut 2010-06-09 11:31:32 +02:00 committed by Harald Welte
parent c614a6a199
commit 10bf812a6a
1 changed files with 2 additions and 4 deletions

View File

@ -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, "