--- a/db/db-schema.sql Tue Mar 06 14:07:55 2012 +0100
+++ b/db/db-schema.sql Tue Apr 24 20:31:58 2012 +0200
@@ -159,6 +159,22 @@
"contact" bigint not null,
"entity" bigint not null
);
+create table "project" (
+ "name" varchar(100) not null,
+ "updated_at" timestamp not null,
+ "id" bigint primary key not null,
+ "description" varchar(40960) not null,
+ "responsible" bigint not null,
+ "deadline" timestamp not null,
+ "ident_s" varchar(256) not null,
+ "state" bigint not null,
+ "note" varchar(10240),
+ "product_line" bigint,
+ "created_at" timestamp not null,
+ "created_by" bigint,
+ "updated_by" bigint
+ );
+create sequence "project_id_seq";
-- foreign key constraints :
alter table "address" add constraint "addressFK1" foreign key ("city_id") references "city"("id");
alter table "city" add constraint "cityFK2" foreign key ("country_id") references "country"("id");
@@ -166,6 +182,9 @@
alter table "company" add constraint "companyFK4" foreign key ("address_id") references "address"("id");
alter table "company" add constraint "companyFK5" foreign key ("post_adress_id") references "address"("id") on delete set null;
alter table "bank_account" add constraint "bank_accountFK6" foreign key ("company_id") references "company"("id") on delete cascade;
+alter table "project" add constraint "projectFK11" foreign key ("responsible") references "user"("id");
+alter table "project" add constraint "projectFK12" foreign key ("product_line") references "code_list_item"("id") on delete set null;
+alter table "project" add constraint "projectFK13" foreign key ("state") references "code_list_item"("id");
alter table "company_contact" add constraint "company_contactFK7" foreign key ("entity") references "company"("id") on delete cascade;
alter table "company_contact" add constraint "company_contactFK8" foreign key ("contact") references "contact"("id") on delete cascade;
alter table "user_contact" add constraint "user_contactFK9" foreign key ("entity") references "user"("id") on delete cascade;