-- person to knowledge (defines the relation between a person and knowledge)
drop table person.p2knowledge;
create table person.p2knowledge
(
        -- unique id generated automatically from sequence
	knowledge_id		integer	not null primary key default nextval('person.sqp2knowledge'),

	person_code		text	not null,

        -- translation for this knowledge, foreign key
	name_id			integer	null,


	constraint c_p2knowledge_fk_person_code foreign key(person_code) references person.person(code)
		match full
		on update cascade
		on delete cascade,

	constraint c_p2knowledge_fk_name_id foreign key(name_id) references global.translate(id)
		match full
		on update cascade
		on delete set default

);
