Commit | Line | Data |
88f2d2fd |
1 | create table a ( |
2 | a_id serial not null, |
3 | primary key (a_id), |
4 | b_id int not null, |
5 | foreign key (b_id) references b (b_id), |
6 | name text |
7 | ); |
8 | |
9 | --create table b ( |
10 | -- b_id serial not null, |
11 | -- primary key (b_id), |
12 | -- name text |
13 | --); |
14 | |
15 | --create table a_b ( |
16 | -- a_b_id serial not null, |
17 | -- primary key (a_b_id), |
18 | -- a_id int not null, |
19 | -- foreign key (a_id) references a (a_id), |
20 | -- b_id int not null, |
21 | -- foreign key (b_id) references b (b_id) |
22 | --); |
23 | |
24 | --create table c ( |
25 | -- c_id serial not null, |
26 | -- primary key (c_id), |
27 | -- b_id int not null, |
28 | -- foreign key (b_id) references b (b_id), |
29 | -- name text |
30 | --); |
31 | |
32 | --create table d ( |
33 | -- d_id serial not null, |
34 | -- primary key (d_id), |
35 | -- c_id int not null, |
36 | -- foreign key (c_id) references c (c_id), |
37 | -- name text |
38 | --); |
39 | |
40 | create table e ( |
41 | e_id serial not null, |
42 | primary key (e_id), |
43 | name text |
44 | ); |
45 | |
46 | --create table c_e ( |
47 | -- c_e_id serial not null, |
48 | -- primary key (c_e_id), |
49 | -- c_id int not null, |
50 | -- foreign key (c_id) references c (c_id), |
51 | -- e_id int not null, |
52 | -- foreign key (e_id) references e (e_id) |
53 | --); |
54 | |
55 | --create table f ( |
56 | -- f_id serial not null, |
57 | -- primary key (f_id), |
58 | -- e1_id int not null, |
59 | -- foreign key (e1_id) references e (e_id), |
60 | -- e2_id int not null, |
61 | -- foreign key (e2_id) references e (e_id) |
62 | --); |
63 | |
64 | create table g ( |
65 | g_id serial not null, |
66 | primary key (g_id), |
67 | a_id int not null, |
68 | foreign key (a_id) references a (a_id), |
69 | e1_id int not null, |
70 | foreign key (e1_id) references e (e_id), |
71 | e2_id int not null, |
72 | foreign key (e2_id) references e (e_id) |
73 | ); |
74 | |
75 | --create table h ( |
76 | -- h_id serial not null, |
77 | -- primary key (h_id), |
78 | -- a1_id int not null, |
79 | -- foreign key (a1_id) references a (a_id), |
80 | -- a2_id int not null, |
81 | -- foreign key (a2_id) references a (a_id), |
82 | -- g1_id int not null, |
83 | -- foreign key (g1_id) references g (g_id), |
84 | -- g2_id int not null, |
85 | -- foreign key (g2_id) references g (g_id) |
86 | --); |