Mercurial > gemma
comparison schema/gemma.sql @ 361:f5087cebc740
Enforce PostgreSQL identifier length on username
A name longer than 63 bytes will be truncated on role creation,
rendering user_profiles.username and the actual name of the role
out of sync. The new CHECK constraint prevents such situation.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 08 Aug 2018 16:31:23 +0200 |
parents | b97b3172c61a |
children | 78588014ad0a |
comparison
equal
deleted
inserted
replaced
360:6d145ee0a097 | 361:f5087cebc740 |
---|---|
38 | 38 |
39 -- Namespace not to be accessed directly by any user | 39 -- Namespace not to be accessed directly by any user |
40 CREATE SCHEMA internal | 40 CREATE SCHEMA internal |
41 -- Profile data are only accessible via the view users.list_users. | 41 -- Profile data are only accessible via the view users.list_users. |
42 CREATE TABLE user_profiles ( | 42 CREATE TABLE user_profiles ( |
43 username varchar PRIMARY KEY, | 43 username varchar PRIMARY KEY CHECK(octet_length(username) <= 63), |
44 -- keep username length compatible with role identifier | |
44 map_extent box2d NOT NULL, | 45 map_extent box2d NOT NULL, |
45 email_address varchar NOT NULL | 46 email_address varchar NOT NULL |
46 ) | 47 ) |
47 -- Columns referencing user-visible schemas added below. | 48 -- Columns referencing user-visible schemas added below. |
48 ; | 49 ; |