summaryrefslogtreecommitdiffstats
path: root/raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql')
-rw-r--r--raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql23
1 files changed, 23 insertions, 0 deletions
diff --git a/raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql b/raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql
new file mode 100644
index 0000000..af86889
--- /dev/null
+++ b/raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql
@@ -0,0 +1,23 @@
+--
+-- Table structure for table 'dhcpippool'
+--
+-- See also "procedure.sql" in this directory for
+-- a stored procedure that gives much faster response.
+--
+
+CREATE TYPE dhcp_status AS ENUM ('dynamic', 'static', 'declined', 'disabled');
+
+CREATE TABLE dhcpippool (
+ id BIGSERIAL PRIMARY KEY,
+ pool_name varchar(64) NOT NULL,
+ FramedIPAddress INET NOT NULL,
+ pool_key VARCHAR(64) NOT NULL default '0',
+ gateway VARCHAR(16) NOT NULL default '',
+ expiry_time TIMESTAMP(0) without time zone NOT NULL default NOW(),
+ status dhcp_status DEFAULT 'dynamic',
+ counter INT NOT NULL default 0
+);
+
+CREATE INDEX dhcpippool_poolname_expire ON dhcpippool USING btree (pool_name, expiry_time);
+CREATE INDEX dhcpippool_framedipaddress ON dhcpippool USING btree (framedipaddress);
+CREATE INDEX dhcpippool_poolname_poolkey_ipaddress ON dhcpippool USING btree (pool_name, pool_key, framedipaddress);