· 6 years ago · Oct 10, 2019, 09:48 PM
1drop schema if exists sh cascade;
2create schema sh;
3
4create table sh.hero (
5 id serial primary key,
6 species text
7);
8
9create table sh.hero_name (
10 id serial primary key,
11 hero_id int not null constraint hero_name_hero_id_fkey references sh.hero (id),
12 name text not null,
13 category text
14);
15
16comment on constraint hero_name_hero_id_fkey on sh.hero_name is
17 E'@foreignFieldName names\n@relationTargetColumn name';