From 7681cc6bcbc0bca9eda98672db3cc8f178dd5082 Mon Sep 17 00:00:00 2001
From: David Sommerseth <dazo@users.sourceforge.net>
Date: Fri, 26 Sep 2008 09:03:05 +0200
Subject: BUGFIX: Changed SQLite database schema to allow mulitple identical
 sessionseeds

This is to comply to the new behaviour after commit
fc8a177bc86fc7e68b15045ba7a791e2504f4b5c.  Now we might get several identical
session seeds, but some of them might be connected to sessions getting
destroyed, while one of them would be connected to an already active session.

sessionkey is now the primary key.
---
 database/sqlite/sql-schema.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'database/sqlite/sql-schema.sql')

diff --git a/database/sqlite/sql-schema.sql b/database/sqlite/sql-schema.sql
index b677554..81d7ea4 100644
--- a/database/sqlite/sql-schema.sql
+++ b/database/sqlite/sql-schema.sql
@@ -103,8 +103,9 @@ CREATE UNIQUE INDEX openvpn_attempts_remoteip ON openvpn_attempts(remoteip);
 CREATE TABLE openvpn_sessionkeys (
        sessionseed      varchar(128)  NOT NULL,
        sessionkey       varchar(128)  NOT NULL,
-       PRIMARY KEY(sessionseed)
+       PRIMARY KEY(sessionkey)
 );
+CREATE INDEX opevpn_sessionkeys_seed ON openvpn_sessionkeys(sessionseed);
 
 CREATE TABLE openvpn_config (
        datakey        varchar(64)  NOT NULL,
-- 
cgit 

