]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
updated SQL templates to support attribute pool and identity parameters
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 12 Jul 2010 18:28:24 +0000 (20:28 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 12 Jul 2010 18:28:34 +0000 (20:28 +0200)
src/libcharon/plugins/sql/mysql.sql
src/libcharon/plugins/sql/sqlite.sql
testing/hosts/default/etc/ipsec.d/tables.sql

index f4a62a6f85f07f32526f8402b1f5dc477da5585f..5a6dd10e9e623cd20a20fe0d455bec2d3f51b897 100644 (file)
@@ -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;
index 55e34e58d7ec6314eb976f0cf0a9e7fa11b59720..fcf5a1470e9b91aa03917006c3c96e569f79bfb7 100644 (file)
@@ -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 (
index eb5f0e4775686ebfcc8f0134a5553f2f6c59a1f0..eb41533cb0aa40e20e5a555005c152e7d34d75c9 100644 (file)
@@ -188,6 +188,7 @@ 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,