Permalink
Browse files

[#1057] Adding subindustry_entity_id to org metadata and fixing its i…

…ndexes
  • Loading branch information...
arowla committed Apr 5, 2012
1 parent 8f25e0d commit 9460176f7635e95c1b0f98b6dad25eea2431f979
@@ -96,8 +96,8 @@ from (
select distinct on (o.entity_id, c.cycle)
o.entity_id,
c.cycle,
- industry.entity_id as subindustry_entity_id,
- sub_industry.entity_id as industry_entity_id
+ industry.entity_id as industry_entity_id,
+ sub_industry.entity_id as subindustry_entity_id
from
organization_associations o
inner join industry_associations i using (transaction_id)
@@ -0,0 +1 @@
+alter table matchbox_organizationmetadata add column subindustry_entity_id uuid;
@@ -0,0 +1,6 @@
+create index matchbox_organizationmetadata__entity_id on matchbox_organizationmetadata (entity_id);
+create index matchbox_organizationmetadata__cycle on matchbox_organizationmetadata (cycle);
+create unique index matchbox_organizationmetadata__entity_id__cycle_unq on matchbox_organizationmetadata (entity_id, cycle);
+drop index matchbox_organizationmetadata_entity_id_key ;
+create index matchbox_organizationmetadata__subindustry_entity_id on matchbox_organizationmetadata (subindustry_entity_id);
+

0 comments on commit 9460176

Please sign in to comment.