]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix postgresql schema for cui
authorJakub Jirutka <jakub@jirutka.cz>
Thu, 20 Feb 2020 00:12:18 +0000 (01:12 +0100)
committerJakub Jirutka <jakub@jirutka.cz>
Fri, 28 Feb 2020 14:34:05 +0000 (15:34 +0100)
I'm getting the following error with the current schema:

    rlm_sql_postgresql: 22001: STRING DATA RIGHT TRUNCATION

Moreover, in PostgreSQL the text type is highly preferred above
varchar. Schema for radacct already uses it, so it seems that schema
for cui is just outdated.

I also remove quotes around `now()`, it was probably some archaism.

raddb/mods-config/sql/cui/postgresql/schema.sql

index 6d54824448d548ebe4e897327bdd8b89d7830fff..c16c54070ee32241e97994b2fe8fe47edf1bb923 100644 (file)
@@ -1,9 +1,9 @@
 CREATE TABLE cui (
        clientipaddress inet NOT NULL DEFAULT '0.0.0.0',
-       callingstationid varchar(50) NOT NULL DEFAULT '',
-       username varchar(64) NOT NULL DEFAULT '',
-       cui varchar(128) NOT NULL DEFAULT '',
-       creationdate timestamp with time zone NOT NULL DEFAULT 'now()',
+       callingstationid text NOT NULL DEFAULT '',
+       username text NOT NULL DEFAULT '',
+       cui text NOT NULL DEFAULT '',
+       creationdate timestamp with time zone NOT NULL DEFAULT now(),
        lastaccounting timestamp with time zone NOT NULL DEFAULT '-infinity'::timestamp,
        PRIMARY KEY (username, clientipaddress, callingstationid)
 );