Skip to content

Commit

Permalink
datahub fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Collins committed Jan 15, 2024
1 parent 502a801 commit 9424bda
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion grails-app/domain/au/org/ala/collectory/DataHub.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -63,7 +65,7 @@ class DataHub implements ProviderGroup, Serializable {
}

static transients = ['collectionMember', 'institutionMember', 'dataResourceMember']

boolean canBeMapped() {
return false;
}
Expand Down
10 changes: 10 additions & 0 deletions grails-app/migrations/5.1.0.3.sql
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 4 additions & 0 deletions grails-app/migrations/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,9 @@ liquibase.command.referencePassword: XXXXX
<sqlFile path="5.1.0.2.sql" relativeToChangelogFile="true" encoding="ISO-8859-1" stripComments="1" />
</changeSet>

<changeSet author="ALA Dev Team" id="20240115-00">
<sqlFile path="5.1.0.3.sql" relativeToChangelogFile="true" encoding="ISO-8859-1" stripComments="1" />
</changeSet>


</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ class CollectoryTagLib {
out << "</ul></p>\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
Expand Down

0 comments on commit 9424bda

Please sign in to comment.