diff --git a/grails-app/domain/au/org/ala/collectory/DataHub.groovy b/grails-app/domain/au/org/ala/collectory/DataHub.groovy index 6bcb6683..21068d2a 100644 --- a/grails-app/domain/au/org/ala/collectory/DataHub.groovy +++ b/grails-app/domain/au/org/ala/collectory/DataHub.groovy @@ -15,6 +15,8 @@ class DataHub implements ProviderGroup, Serializable { String members = '[]' // non-overlapping json list of uids of member institutions and collections // (suitable for identifying a unique list of occurrence records) + static hasMany = [externalIdentifiers: ExternalIdentifier] + static constraints = { guid(nullable:true, maxSize:256) uid(blank:false, maxSize:20) @@ -63,7 +65,7 @@ class DataHub implements ProviderGroup, Serializable { } static transients = ['collectionMember', 'institutionMember', 'dataResourceMember'] - + boolean canBeMapped() { return false; } diff --git a/grails-app/migrations/5.1.0.3.sql b/grails-app/migrations/5.1.0.3.sql new file mode 100644 index 00000000..f4e74e5d --- /dev/null +++ b/grails-app/migrations/5.1.0.3.sql @@ -0,0 +1,10 @@ +CREATE TABLE `data_hub_external_identifier` ( + `data_hub_external_identifiers_id` bigint NOT NULL, + `external_identifier_id` bigint DEFAULT NULL, + KEY `FKirj1ih9m2xspn1aki6xoeavsx` (`external_identifier_id`), + KEY `FKiwkh0on1fsiy5on971yoi0e0q` (`data_hub_external_identifiers_id`), + CONSTRAINT `FKirj1ih9m2xspn1aki6xoeavsx` FOREIGN KEY (`external_identifier_id`) REFERENCES `external_identifier` (`id`), + CONSTRAINT `FKiwkh0on1fsiy5on971yoi0e0q` FOREIGN KEY (`data_hub_external_identifiers_id`) REFERENCES `data_hub` (`id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +insert into `data_hub_external_identifier` (`data_hub_external_identifiers_id`, `external_identifier_id`) select c.id, e.id from external_identifier e inner join data_hub c on e.entity_uid = c.uid; diff --git a/grails-app/migrations/changelog.xml b/grails-app/migrations/changelog.xml index d3ebea2f..95176f4e 100644 --- a/grails-app/migrations/changelog.xml +++ b/grails-app/migrations/changelog.xml @@ -445,5 +445,9 @@ liquibase.command.referencePassword: XXXXX + + + + diff --git a/grails-app/taglib/au/org/ala/collectory/CollectoryTagLib.groovy b/grails-app/taglib/au/org/ala/collectory/CollectoryTagLib.groovy index 7dee5244..29d39c39 100644 --- a/grails-app/taglib/au/org/ala/collectory/CollectoryTagLib.groovy +++ b/grails-app/taglib/au/org/ala/collectory/CollectoryTagLib.groovy @@ -1468,7 +1468,7 @@ class CollectoryTagLib { out << "

\n" } def consumers = [] - if (attrs.instance instanceof DataProvider || attrs.instance instanceof DataResource) { + if (attrs.instance instanceof DataResource) { consumers += attrs.instance.consumerInstitutions + attrs.instance.consumerCollections if (attrs.instance.dataProvider) { consumers += attrs.instance.dataProvider.consumerInstitutions + attrs.instance.dataProvider.consumerCollections