]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add new 'Class' column into post-auth / SQL schemas (#4071)
authorJorge Pereira <jpereira@users.noreply.github.com>
Thu, 13 May 2021 15:16:35 +0000 (12:16 -0300)
committerGitHub <noreply@github.com>
Thu, 13 May 2021 15:16:35 +0000 (17:16 +0200)
13 files changed:
raddb/mods-config/sql/main/cassandra/queries.conf
raddb/mods-config/sql/main/cassandra/schema.sql
raddb/mods-config/sql/main/mssql/queries.conf
raddb/mods-config/sql/main/mssql/schema.sql
raddb/mods-config/sql/main/mysql/queries.conf
raddb/mods-config/sql/main/mysql/schema.sql
raddb/mods-config/sql/main/ndb/schema.sql
raddb/mods-config/sql/main/oracle/queries.conf
raddb/mods-config/sql/main/oracle/schema.sql
raddb/mods-config/sql/main/postgresql/queries.conf
raddb/mods-config/sql/main/postgresql/schema.sql
raddb/mods-config/sql/main/sqlite/queries.conf
raddb/mods-config/sql/main/sqlite/schema.sql

index 5a9267fd7fa68e181c53eb9e32e3f660c074afaa..f15d4d3f74a1dfdb7ac7b7765c55f08faee74783 100644 (file)
@@ -365,10 +365,11 @@ post-auth {
 
        query = "\
                INSERT INTO ${..postauth_table} \
-                       (username, pass, reply, authdate) \
+                       (username, pass, reply, authdate, class) \
                VALUES ( \
                        '%{SQL-User-Name}', \
                        '%{%{User-Password}:-%{Chap-Password}}', \
                        '%{reply.Packet-Type}', \
-                       '%{expr:%l * 1000 + %M / 1000}')"
+                       '%{expr:%l * 1000 + %M / 1000}', \
+                       '%{reply.Class}')"
 }
index d97b77366e2f164686d8aa91b711dbd7a02ba9bd..90a5b0b723e26d76e64601bc603e468fc2c0e031 100644 (file)
@@ -71,6 +71,7 @@ CREATE TABLE radpostauth (
   pass text,
   reply text,
   authdate timestamp,
+  class text,
   PRIMARY KEY (username, authdate)
 ) WITH CLUSTERING ORDER BY (authdate ASC);
 
index ed4421ff5197ba1a4846ab299385fd2dc21861aa..8eac4177cbe4703f2df4ff5c24739e28482159c8 100644 (file)
@@ -366,10 +366,11 @@ post-auth {
 
        query = "\
                INSERT INTO ${..postauth_table} \
-                       (userName, pass, reply, authdate) \
+                       (userName, pass, reply, authdate, class) \
                VALUES(\
                        '%{User-Name}', \
                        '%{%{User-Password}:-CHAP-PASSWORD}', \
                        '%{reply.Packet-Type}', \
-                       '%S.%{expr:%M / 1000}')"
+                       '%S.%{expr:%M / 1000}', \
+                       '%{reply.Class}')"
 }
index 3361015685d9dc3435b530ba12e2e885a0737bdf..7eeb61ff4a9e6a37a90376c0db0cbfe8156427db 100644 (file)
@@ -276,7 +276,8 @@ CREATE TABLE [radpostauth] (
        [userName] [varchar] (64) NOT NULL ,
        [pass] [varchar] (64) NOT NULL ,
        [reply] [varchar] (32) NOT NULL ,
-       [authdate] [datetime] NOT NULL
+       [authdate] [datetime] NOT NULL,
+       [class] [varchar] (64) NULL
 )
 GO
 
@@ -285,6 +286,7 @@ ALTER TABLE [radpostauth] WITH NOCHECK ADD
        CONSTRAINT [DF_radpostauth_pass] DEFAULT ('') FOR [pass],
        CONSTRAINT [DF_radpostauth_reply] DEFAULT ('') FOR [reply],
        CONSTRAINT [DF_radpostauth_authdate] DEFAULT (getdate()) FOR [authdate],
+       CONSTRAINT [DF_radpostauth_class] DEFAULT ('') FOR [class],
        CONSTRAINT [PK_radpostauth] PRIMARY KEY NONCLUSTERED
        (
                [id]
index 8f4625aec12a9b39b6f505b8d8f7da08d4b70d57..0a6a0e1b8f683277a797b967fda0a4c0da19c326 100644 (file)
@@ -396,10 +396,11 @@ post-auth {
 
        query = "\
                INSERT INTO ${..postauth_table} \
-                       (username, pass, reply, authdate) \
+                       (username, pass, reply, authdate, class) \
                VALUES ( \
                        '%{SQL-User-Name}', \
                        '%{%{User-Password}:-%{Chap-Password}}', \
                        '%{reply.Packet-Type}', \
-                       '%S.%M')"
+                       '%S.%M', \
+                       '%{reply.Class}')"
 }
index 2fa9f5888d7288d18d7a500d8ece8dd61542ee07..a2053cfb7189ba1dada99403606c70c03b4cdb26 100644 (file)
@@ -147,6 +147,7 @@ CREATE TABLE radpostauth (
   pass varchar(64) NOT NULL default '',
   reply varchar(32) NOT NULL default '',
   authdate timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
+  class varchar(64) NOT NULL default '',
   PRIMARY KEY  (id)
 ) ENGINE = INNODB;
 
index 2897494ce17f6ed0757980a3eacf636ef2b80d7d..22b95f7d99eb0b9ed9461e49fbd8445c77adedaa 100644 (file)
@@ -141,5 +141,6 @@ CREATE TABLE radpostauth (
   pass varchar(64) NOT NULL default '',
   reply varchar(32) NOT NULL default '',
   authdate timestamp NOT NULL,
+  class varchar(64) NOT NULL default '',
   PRIMARY KEY  (id)
 ) ENGINE=ndbcluster;
index 7be44903262a5b6d6729f23d81c3a11dff7c9030..df77a5718f9255ee72210faa608e3887f355f6c8 100644 (file)
@@ -419,10 +419,11 @@ post-auth {
 #      logfile = ${logdir}/post-auth.sql
        query = "\
                INSERT INTO ${..postauth_table} \
-                       (username, pass, reply, authdate) \
+                       (username, pass, reply, authdate, class) \
                VALUES (\
                        '%{User-Name}', \
                        '%{%{User-Password}:-%{Chap-Password}}', \
                        '%{reply.Packet-Type}', \
-                       TO_TIMESTAMP('%S.%M','YYYY-MM-DDHH24:MI:SS.FF'))"
+                       TO_TIMESTAMP('%S.%M','YYYY-MM-DDHH24:MI:SS.FF'), \
+                       '%{reply.Class}')"
 }
index 7cda4fef3082d27c9e20555ec081c2ac8f46b46c..c049bd9686d126c60e713fc9534f2d018d66a71f 100644 (file)
@@ -207,7 +207,8 @@ CREATE TABLE radpostauth (
          UserName      VARCHAR(64) NOT NULL,
          Pass          VARCHAR(64),
          Reply         VARCHAR(64),
-         AuthDate      TIMESTAMP(6) WITH TIME ZONE
+         AuthDate      TIMESTAMP(6) WITH TIME ZONE,
+         Class         VARCHAR(64),
 );
 
 CREATE SEQUENCE radpostauth_seq START WITH 1 INCREMENT BY 1;
index 86a3ba1387da4d275943317912e6aa9e908ce09d..e6d770b1e0a48eb7bf81e77bc34dee3005b9a338 100644 (file)
@@ -469,10 +469,11 @@ post-auth {
 
        query = "\
                INSERT INTO ${..postauth_table} \
-                       (username, pass, reply, authdate) \
+                       (username, pass, reply, authdate, class) \
                VALUES(\
                        '%{User-Name}', \
                        '%{%{User-Password}:-Chap-Password}', \
                        '%{reply.Packet-Type}', \
-                       '%S.%M')"
+                       '%S.%M', \
+                       '%{reply.Class}')"
 }
index 9a73c7cbbffee5ff80592a6c223f6dab48680866..c88af7f66f3579ab94552c7739ee21c46f6f9545 100644 (file)
@@ -152,7 +152,8 @@ CREATE TABLE radpostauth (
        reply                   text,
        CalledStationId         text,
        CallingStationId        text,
-       authdate                timestamp with time zone NOT NULL default now()
+       authdate                timestamp with time zone NOT NULL default now(),
+       Class                   text,
 );
 
 --
index e3abb905c09204b474b9d3d73cbecaf59eaba525..3a5bfd6245a9011bdbf0fa4923d8713c030bcf1d 100644 (file)
@@ -412,10 +412,11 @@ post-auth {
 
        query = "\
                INSERT INTO ${..postauth_table} \
-                       (username, pass, reply, authdate) \
+                       (username, pass, reply, authdate, class) \
                VALUES ( \
                        '%{SQL-User-Name}', \
                        '%{%{User-Password}:-%{Chap-Password}}', \
                        '%{reply.Packet-Type}', \
-                       '%S.%M')"
+                       '%S.%M', \
+                       '%{reply.Class}')"
 }
index 790ce2d91218ad8d8f7765242f63b874ccdcc637..1e85f13222a0f720aa9f1e90be06418de557f1e8 100644 (file)
@@ -127,7 +127,8 @@ CREATE TABLE radpostauth (
        username varchar(64) NOT NULL default '',
        pass varchar(64) NOT NULL default '',
        reply varchar(32) NOT NULL default '',
-       authdate timestamp NOT NULL
+       authdate timestamp NOT NULL,
+       class varchar(64) NOT NULL default ''
 );
 
 --