aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/sql
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-07-12 20:28:24 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-07-12 20:28:34 +0200
commitab635e029ec5a88d41aaa3dbf864d1ae6bd9a982 (patch)
treec03acdf34c8116cc0d9ca454c7f33f43ad440021 /src/libcharon/plugins/sql
parentcb0a9d58a38d2fe163eb61d350f403a47842cdca (diff)
downloadstrongswan-ab635e029ec5a88d41aaa3dbf864d1ae6bd9a982.tar.bz2
strongswan-ab635e029ec5a88d41aaa3dbf864d1ae6bd9a982.tar.xz
updated SQL templates to support attribute pool and identity parameters
Diffstat (limited to 'src/libcharon/plugins/sql')
-rw-r--r--src/libcharon/plugins/sql/mysql.sql14
-rw-r--r--src/libcharon/plugins/sql/sqlite.sql16
2 files changed, 29 insertions, 1 deletions
diff --git a/src/libcharon/plugins/sql/mysql.sql b/src/libcharon/plugins/sql/mysql.sql
index f4a62a6f8..5a6dd10e9 100644
--- a/src/libcharon/plugins/sql/mysql.sql
+++ b/src/libcharon/plugins/sql/mysql.sql
@@ -187,11 +187,23 @@ CREATE TABLE leases (
PRIMARY KEY (`id`)
);
+DROP TABLE IF EXISTS attribute_pools;
+CREATE TABLE attribute_pools (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `name` varchar(32) NOT NULL,
+ PRIMARY KEY (`id`)
+);
+
DROP TABLE IF EXISTS attributes;
CREATE TABLE attributes (
`id` int(10) unsigned NOT NULL auto_increment,
+ `identity` int(10) unsigned NOT NULL default '0',
+ `pool` int(10) unsigned NOT NULL default '0',
`type` int(10) unsigned NOT NULL,
- `value` varbinary(16) NOT NULL
+ `value` varbinary(16) NOT NULL,
+ PRIMARY KEY (`id`),
+ INDEX (`identity`),
+ INDEX (`pool`)
);
DROP TABLE IF EXISTS ike_sas;
diff --git a/src/libcharon/plugins/sql/sqlite.sql b/src/libcharon/plugins/sql/sqlite.sql
index 55e34e58d..fcf5a1470 100644
--- a/src/libcharon/plugins/sql/sqlite.sql
+++ b/src/libcharon/plugins/sql/sqlite.sql
@@ -192,12 +192,28 @@ CREATE TABLE leases (
released INTEGER NOT NULL
);
+DROP TABLE IF EXISTS attribute_pools;
+CREATE TABLE attribute_pools (
+ id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL
+);
+
DROP TABLE IF EXISTS attributes;
CREATE TABLE attributes (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ identity INTEGER NOT NULL DEFAULT 0,
+ pool INTEGER NOT NULL DEFAULT 0,
type INTEGER NOT NULL,
value BLOB NOT NULL
);
+DROP INDEX IF EXISTS attributes_identity;
+CREATE INDEX attributes_identity ON attributes (
+ identity
+);
+DROP INDEX IF EXISTS attributes_pool;
+CREATE INDEX attributes_pool ON attributes (
+ pool
+);
DROP TABLE IF EXISTS ike_sas;
CREATE TABLE ike_sas (