From: kkalev Date: Tue, 22 Jun 2004 14:01:22 +0000 (+0000) Subject: Add postgresql specific sql schema by apellido jr., wilfredo p. Move each sql schema... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=4917cd0d04b1eb39d41ba8d5e1bdd8fa77603d21;p=freeradius-dialup-admin.git Add postgresql specific sql schema by apellido jr., wilfredo p. Move each sql schema to a separate directory (mysql and postgresql) --- diff --git a/Changelog b/Changelog index 32d2db1..d4d0cd4 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,8 @@ Ver 1.72: only be able to administer those access servers and not see the rest of the nas list. * Add username searching in the find page as suggested by joram agten * Don't use nas_list in nas_admin +* Add postgresql specific sql schema by apellido jr., wilfredo p. Move each sql schema to a + separate directory (mysql and postgresql) Ver 1.70: * Add the /bin postgresql compatibility patch from Guy Fraser * Add ldap_userdn as a configuration directive. If set we use that for diff --git a/sql/badusers.sql b/sql/mysql/badusers.sql similarity index 100% rename from sql/badusers.sql rename to sql/mysql/badusers.sql diff --git a/sql/mtotacct.sql b/sql/mysql/mtotacct.sql similarity index 100% rename from sql/mtotacct.sql rename to sql/mysql/mtotacct.sql diff --git a/sql/totacct.sql b/sql/mysql/totacct.sql similarity index 100% rename from sql/totacct.sql rename to sql/mysql/totacct.sql diff --git a/sql/userinfo.sql b/sql/mysql/userinfo.sql similarity index 100% rename from sql/userinfo.sql rename to sql/mysql/userinfo.sql diff --git a/sql/postgresql/badusers.sql b/sql/postgresql/badusers.sql new file mode 100644 index 0000000..7312704 --- /dev/null +++ b/sql/postgresql/badusers.sql @@ -0,0 +1,13 @@ +SET search_path = public, pg_catalog; + +--Table structure for table 'badusers' +-- +CREATE TABLE badusers ( + id BIGSERIAL PRIMARY KEY, + username TEXT NOT NULL, + date timestamp with time zone DEFAULT 'now' NOT NULL, + reason TEXT, + admin TEXT DEFAULT '-' +); +CREATE INDEX badusers_actiondate_idx ON badusers USING btree (actiondate); +CREATE INDEX badusers_username_idx ON badusers USING btree (username); diff --git a/sql/postgresql/mtotacct.sql b/sql/postgresql/mtotacct.sql new file mode 100644 index 0000000..f8502e1 --- /dev/null +++ b/sql/postgresql/mtotacct.sql @@ -0,0 +1,23 @@ +SET search_path = public, pg_catalog; + +-- +-- Table structure for table 'mtotacct' +-- +CREATE TABLE mtotacct ( + mtotacctid BIGSERIAL PRIMARY KEY, + username TEXT DEFAULT '' NOT NULL, + acctdate DATE DEFAULT 'now' NOT NULL, + connnum BIGINT, + conntotduration BIGINT, + connmaxduration BIGINT, + connminduration BIGINT, + inputoctets BIGINT, + outputoctets BIGINT, + nasipaddress INET +); +CREATE INDEX mtotacct_acctdate_idx ON mtotacct USING btree (acctdate); +CREATE INDEX mtotacct_nasipaddress_idx ON mtotacct USING btree +(nasipaddress); +CREATE INDEX mtotacct_username_idx ON mtotacct USING btree (username); +CREATE INDEX mtotacct_userondate_idx ON mtotacct USING btree (username, +acctdate); diff --git a/sql/postgresql/totacct.sql b/sql/postgresql/totacct.sql new file mode 100644 index 0000000..373aae4 --- /dev/null +++ b/sql/postgresql/totacct.sql @@ -0,0 +1,24 @@ +SET search_path = public, pg_catalog; + +-- +-- Table structure for table 'totacct' +-- +CREATE TABLE totacct ( + totacctid bigSERIAL PRIMARY KEY, + username TEXT DEFAULT '' NOT NULL, + acctdate DATE DEFAULT 'now' NOT NULL, + connnum BIGINT, + conntotduration BIGINT, + connmaxduration BIGINT, + connminduration BIGINT, + inputoctets BIGINT, + outputoctets BIGINT, + nasipaddress INET +); +CREATE INDEX totacct_acctdate_idx ON totacct USING btree (acctdate); +CREATE INDEX totacct_nasipaddress_idx ON totacct USING btree (nasipaddress); +CREATE INDEX totacct_nasondate_idx ON totacct USING btree (acctdate, +nasipaddress); +CREATE INDEX totacct_username_idx ON totacct USING btree (username); +CREATE INDEX totacct_userondate_idx ON totacct USING btree (username, +acctdate); diff --git a/sql/postgresql/userinfo.sql b/sql/postgresql/userinfo.sql new file mode 100644 index 0000000..644bc95 --- /dev/null +++ b/sql/postgresql/userinfo.sql @@ -0,0 +1,19 @@ +SET search_path = public, pg_catalog; + +-- +-- Table structure for table 'userinfo' +-- +CREATE TABLE userinfo ( + id SERIAL PRIMARY KEY, + username TEXT, + name TEXT, + mail TEXT, + department TEXT, + workphone TEXT, + homephone TEXT, + mobile TEXT +); +CREATE INDEX userinfo_department_idx ON userinfo USING btree (department); +CREATE INDEX userinfo_username_idx ON userinfo USING btree (username); + +