-- Deploy camper:legal_text_i18n to pg
-- requires: roles
-- requires: schema_camper
-- requires: legal_text
-- requires: language

begin;

set search_path to camper, public;

create table legal_text_i18n (
	company_id integer not null,
	slug text not null,
	lang_tag text not null references language,
	name text not null,
	content xml not null,
	foreign key (company_id, slug) references legal_text,
	primary key (company_id, slug, lang_tag)
);

grant select on table legal_text_i18n to guest;
grant select on table legal_text_i18n to employee;
grant select, insert, update, delete on table legal_text_i18n to admin;

commit;
