db/db-schema.sql
changeset 83 f7553032b302
parent 81 c7d21399c726
child 85 3ef84ec492fa
equal deleted inserted replaced
82:ad2fe2f9bac7 83:f7553032b302
   188     "created_by" bigint,
   188     "created_by" bigint,
   189     "task_type" bigint,
   189     "task_type" bigint,
   190     "updated_by" bigint
   190     "updated_by" bigint
   191   );
   191   );
   192 create sequence "task_id_seq";
   192 create sequence "task_id_seq";
       
   193 create table "comment" (
       
   194     "name" varchar(100) not null,
       
   195     "updated_at" timestamp not null,
       
   196     "task_id" bigint not null,
       
   197     "id" bigint primary key not null,
       
   198     "note" varchar(10240),
       
   199     "created_at" timestamp not null,
       
   200     "created_by" bigint,
       
   201     "updated_by" bigint
       
   202   );
       
   203 create sequence "comment_id_seq";
   193 -- foreign key constraints :
   204 -- foreign key constraints :
   194 alter table "address" add constraint "addressFK1" foreign key ("city_id") references "city"("id");
   205 alter table "address" add constraint "addressFK1" foreign key ("city_id") references "city"("id");
   195 alter table "city" add constraint "cityFK2" foreign key ("country_id") references "country"("id");
   206 alter table "city" add constraint "cityFK2" foreign key ("country_id") references "country"("id");
   196 alter table "location" add constraint "locationFK3" foreign key ("address_id") references "address"("id");
   207 alter table "location" add constraint "locationFK3" foreign key ("address_id") references "address"("id");
   197 alter table "company" add constraint "companyFK4" foreign key ("address_id") references "address"("id");
   208 alter table "company" add constraint "companyFK4" foreign key ("address_id") references "address"("id");
   202 alter table "project" add constraint "projectFK13" foreign key ("state") references "code_list_item"("id");
   213 alter table "project" add constraint "projectFK13" foreign key ("state") references "code_list_item"("id");
   203 alter table "task" add constraint "taskFK14" foreign key ("responsible") references "user"("id");
   214 alter table "task" add constraint "taskFK14" foreign key ("responsible") references "user"("id");
   204 alter table "task" add constraint "taskFK15" foreign key ("task_type") references "code_list_item"("id");
   215 alter table "task" add constraint "taskFK15" foreign key ("task_type") references "code_list_item"("id");
   205 alter table "task" add constraint "taskFK16" foreign key ("state") references "code_list_item"("id");
   216 alter table "task" add constraint "taskFK16" foreign key ("state") references "code_list_item"("id");
   206 alter table "task" add constraint "taskFK17" foreign key ("project_id") references "project"("id");
   217 alter table "task" add constraint "taskFK17" foreign key ("project_id") references "project"("id");
       
   218 alter table "comment" add constraint "commentFK18" foreign key ("task_id") references "task"("id") on delete cascade;
   207 alter table "company_contact" add constraint "company_contactFK7" foreign key ("entity") references "company"("id") on delete cascade;
   219 alter table "company_contact" add constraint "company_contactFK7" foreign key ("entity") references "company"("id") on delete cascade;
   208 alter table "company_contact" add constraint "company_contactFK8" foreign key ("contact") references "contact"("id") on delete cascade;
   220 alter table "company_contact" add constraint "company_contactFK8" foreign key ("contact") references "contact"("id") on delete cascade;
   209 alter table "user_contact" add constraint "user_contactFK9" foreign key ("entity") references "user"("id") on delete cascade;
   221 alter table "user_contact" add constraint "user_contactFK9" foreign key ("entity") references "user"("id") on delete cascade;
   210 alter table "user_contact" add constraint "user_contactFK10" foreign key ("contact") references "contact"("id") on delete cascade;
   222 alter table "user_contact" add constraint "user_contactFK10" foreign key ("contact") references "contact"("id") on delete cascade;
   211 -- composite key indexes :
   223 -- composite key indexes :