tipus/deploy/language.sql
jordi fita mas 301195efac Add authentication relations, views, and functions for PostgreSQL
Most of them are exactly the same as we use for Numerus, but with the
main application schema changed to tipus.
2023-06-04 22:45:44 +02:00

33 lines
848 B
PL/PgSQL

-- Deploy tipus:language to pg
-- requires: roles
-- requires: schema_public
begin;
set search_path to public;
create table language
(
lang_tag text primary key check (length(lang_tag) < 36), -- RFC5646 recommends 35 at least
name text not null,
endonym text not null,
selectable boolean not null,
currency_pattern text not null
);
grant select on table language to guest;
grant select on table language to publisher;
grant select on table language to admin;
grant select on table language to authenticator;
comment on table language is
'Languages/locales available in Tipus';
comment on column language.lang_tag is
'BCP-47 language tag';
comment on column language.selectable is
'Whether the language should be a option in a user-facing select control.';
commit;