-- Deploy numerus:language to pg
-- requires: schema_numerus

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
);

grant select on table language to guest;
grant select on table language to invoicer;
grant select on table language to admin;
grant select on table language to authenticator;

comment on table language is
'Languages/locales available in Numerus';

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;
