173 "updated_by" bigint |
173 "updated_by" bigint |
174 ); |
174 ); |
175 create sequence "attachment_id_seq"; |
175 create sequence "attachment_id_seq"; |
176 create table "project" ( |
176 create table "project" ( |
177 "id" bigint primary key not null, |
177 "id" bigint primary key not null, |
|
178 "phase" bigint not null, |
178 "name" varchar(100) not null, |
179 "name" varchar(100) not null, |
179 "description" varchar(40960) not null, |
180 "description" varchar(40960) not null, |
180 "responsible" bigint not null, |
181 "responsible" bigint not null, |
181 "deadline" timestamp not null, |
182 "deadline" timestamp not null, |
182 "ident_s" varchar(256) not null, |
183 "ident_s" varchar(256) not null, |
183 "state" bigint not null, |
184 "state" bigint not null, |
184 "product_line" bigint, |
185 "product_line" bigint, |
|
186 "location_a" varchar(1024) not null, |
|
187 "location_b" varchar(1024) not null, |
185 "note" varchar(10240), |
188 "note" varchar(10240), |
186 "created_at" timestamp not null, |
189 "created_at" timestamp not null, |
187 "created_by" bigint, |
190 "created_by" bigint, |
188 "updated_at" timestamp not null, |
191 "updated_at" timestamp not null, |
189 "updated_by" bigint |
192 "updated_by" bigint |
264 alter table "company" add foreign key ("post_adress_id") references "address"("id") on delete set null; |
267 alter table "company" add foreign key ("post_adress_id") references "address"("id") on delete set null; |
265 alter table "bank_account" add foreign key ("company_id") references "company"("id") on delete cascade; |
268 alter table "bank_account" add foreign key ("company_id") references "company"("id") on delete cascade; |
266 alter table "project" add foreign key ("responsible") references "user"("id"); |
269 alter table "project" add foreign key ("responsible") references "user"("id"); |
267 alter table "project" add foreign key ("product_line") references "code_list_item"("id") on delete set null; |
270 alter table "project" add foreign key ("product_line") references "code_list_item"("id") on delete set null; |
268 alter table "project" add foreign key ("state") references "code_list_item"("id"); |
271 alter table "project" add foreign key ("state") references "code_list_item"("id"); |
|
272 alter table "project" add foreign key ("phase") references "code_list_item"("id"); |
269 alter table "task" add foreign key ("responsible") references "user"("id"); |
273 alter table "task" add foreign key ("responsible") references "user"("id"); |
270 alter table "task" add foreign key ("task_type") references "code_list_item"("id"); |
274 alter table "task" add foreign key ("task_type") references "code_list_item"("id"); |
271 alter table "task" add foreign key ("state") references "code_list_item"("id"); |
275 alter table "task" add foreign key ("state") references "code_list_item"("id"); |
272 alter table "task" add foreign key ("project_id") references "project"("id"); |
276 alter table "task" add foreign key ("project_id") references "project"("id"); |
273 alter table "comment" add foreign key ("task_id") references "task"("id") on delete cascade; |
277 alter table "comment" add foreign key ("task_id") references "task"("id") on delete cascade; |