src/main/resources/db/db-schema.sql
changeset 98 eac38214183d
parent 92 eb207b189332
child 99 49eb72a46208
--- a/src/main/resources/db/db-schema.sql	Thu May 03 22:31:09 2012 +0200
+++ b/src/main/resources/db/db-schema.sql	Wed May 09 22:53:03 2012 +0200
@@ -206,6 +206,10 @@
     "project" bigint not null,
     "company" bigint not null
   );
+create table "project_location" (
+    "location" bigint not null,
+    "project" bigint not null
+  );
 -- foreign key constraints :
 alter table "address" add foreign key ("city_id") references "city"("id");
 alter table "city" add foreign key ("country_id") references "country"("id");
@@ -228,9 +232,12 @@
 alter table "user_contact" add foreign key ("contact") references "contact"("id") on delete cascade;
 alter table "project_company" add foreign key ("project") references "project"("id") on delete cascade;
 alter table "project_company" add foreign key ("company") references "company"("id") on delete cascade;
+alter table "project_location" add foreign key ("project") references "project"("id") on delete cascade;
+alter table "project_location" add foreign key ("location") references "location"("id") on delete cascade;
 -- composite key indexes :
 alter table "company_contact" add unique("entity","contact");
 alter table "user_contact" add unique("entity","contact");
 alter table "project_company" add unique("project","company");
+alter table "project_location" add unique("project","location");
 -- column group indexes :
 create index "user_deleted_active_idx" on "user" ("deleted","active");