db/db-schema.sql
changeset 81 c7d21399c726
parent 79 25392159b6ca
child 83 f7553032b302
equal deleted inserted replaced
80:196896cc3f58 81:c7d21399c726
   173     "created_at" timestamp not null,
   173     "created_at" timestamp not null,
   174     "created_by" bigint,
   174     "created_by" bigint,
   175     "updated_by" bigint
   175     "updated_by" bigint
   176   );
   176   );
   177 create sequence "project_id_seq";
   177 create sequence "project_id_seq";
       
   178 create table "task" (
       
   179     "name" varchar(100) not null,
       
   180     "updated_at" timestamp not null,
       
   181     "id" bigint primary key not null,
       
   182     "project_id" bigint not null,
       
   183     "responsible" bigint not null,
       
   184     "deadline" timestamp not null,
       
   185     "state" bigint not null,
       
   186     "note" varchar(10240),
       
   187     "created_at" timestamp not null,
       
   188     "created_by" bigint,
       
   189     "task_type" bigint,
       
   190     "updated_by" bigint
       
   191   );
       
   192 create sequence "task_id_seq";
   178 -- foreign key constraints :
   193 -- foreign key constraints :
   179 alter table "address" add constraint "addressFK1" foreign key ("city_id") references "city"("id");
   194 alter table "address" add constraint "addressFK1" foreign key ("city_id") references "city"("id");
   180 alter table "city" add constraint "cityFK2" foreign key ("country_id") references "country"("id");
   195 alter table "city" add constraint "cityFK2" foreign key ("country_id") references "country"("id");
   181 alter table "location" add constraint "locationFK3" foreign key ("address_id") references "address"("id");
   196 alter table "location" add constraint "locationFK3" foreign key ("address_id") references "address"("id");
   182 alter table "company" add constraint "companyFK4" foreign key ("address_id") references "address"("id");
   197 alter table "company" add constraint "companyFK4" foreign key ("address_id") references "address"("id");
   183 alter table "company" add constraint "companyFK5" foreign key ("post_adress_id") references "address"("id") on delete set null;
   198 alter table "company" add constraint "companyFK5" foreign key ("post_adress_id") references "address"("id") on delete set null;
   184 alter table "bank_account" add constraint "bank_accountFK6" foreign key ("company_id") references "company"("id") on delete cascade;
   199 alter table "bank_account" add constraint "bank_accountFK6" foreign key ("company_id") references "company"("id") on delete cascade;
   185 alter table "project" add constraint "projectFK11" foreign key ("responsible") references "user"("id");
   200 alter table "project" add constraint "projectFK11" foreign key ("responsible") references "user"("id");
   186 alter table "project" add constraint "projectFK12" foreign key ("product_line") references "code_list_item"("id") on delete set null;
   201 alter table "project" add constraint "projectFK12" foreign key ("product_line") references "code_list_item"("id") on delete set null;
   187 alter table "project" add constraint "projectFK13" foreign key ("state") references "code_list_item"("id");
   202 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");
       
   204 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");
       
   206 alter table "task" add constraint "taskFK17" foreign key ("project_id") references "project"("id");
   188 alter table "company_contact" add constraint "company_contactFK7" foreign key ("entity") references "company"("id") on delete cascade;
   207 alter table "company_contact" add constraint "company_contactFK7" foreign key ("entity") references "company"("id") on delete cascade;
   189 alter table "company_contact" add constraint "company_contactFK8" foreign key ("contact") references "contact"("id") on delete cascade;
   208 alter table "company_contact" add constraint "company_contactFK8" foreign key ("contact") references "contact"("id") on delete cascade;
   190 alter table "user_contact" add constraint "user_contactFK9" foreign key ("entity") references "user"("id") on delete cascade;
   209 alter table "user_contact" add constraint "user_contactFK9" foreign key ("entity") references "user"("id") on delete cascade;
   191 alter table "user_contact" add constraint "user_contactFK10" foreign key ("contact") references "contact"("id") on delete cascade;
   210 alter table "user_contact" add constraint "user_contactFK10" foreign key ("contact") references "contact"("id") on delete cascade;
   192 -- composite key indexes :
   211 -- composite key indexes :