diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 32ea20a0c39ffc1189d1875749a3cda52fd088fd..a9c6dee08672fa428bdc1a916f67222a830fe109 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -417,6 +417,7 @@ services: hostname: metric-db image: docker.io/bitnami/prometheus:2.54.1-debian-12-r4 volumes: + - ./config/prometheus.yml:/etc/prometheus/prometheus.yml - ./config/prometheus.yml:/etc/prometheus/prometheus.yml - metric-db-data:/opt/bitnami/prometheus/data healthcheck: diff --git a/dbrepo-metadata-db/migration/16/data.py b/dbrepo-metadata-db/migration/16/data.py index cd81ea5b4d0fb4bad1fdc67c55e19401875a59bb..e321eb38b7538699a0fefef1a1e0a4d31abf9b3e 100644 --- a/dbrepo-metadata-db/migration/16/data.py +++ b/dbrepo-metadata-db/migration/16/data.py @@ -4,9 +4,9 @@ import uuid from dbrepo.RestClient import RestClient -endpoint = os.getenv('METADATA_SERVICE_ENDPOINT', 'https://dbrepo1.ec.tuwien.ac.at') +endpoint = os.getenv('METADATA_SERVICE_ENDPOINT', 'http://localhost') username = os.getenv('SYSTEM_USERNAME', 'admin') -password = os.getenv('SYSTEM_PASSWORD', 'f24870437f82adf567c0b03179f15e21') +password = os.getenv('SYSTEM_PASSWORD', 'admin') client = RestClient(endpoint=endpoint, username=username, password=password) plan: [str] = [] @@ -89,12 +89,17 @@ def update_databases() -> None: plan.append(f"UPDATE mdb_view SET vdbid = '{new_id}' WHERE vdbid = '{old_id}';") plan.append(f"UPDATE mdb_identifiers SET dbid = '{new_id}' WHERE dbid = '{old_id}';") plan.append(f"UPDATE mdb_access SET aDBID = '{new_id}' WHERE aDBID = '{old_id}';") - for view in database.views: - v_old_id: int = view.id + for _view in database.views: + v_old_id: int = _view.id v_new_id: uuid = uuid.uuid4() + view = client.get_view(database_id=_database.id, view_id=_view.id) plan.append(f"UPDATE mdb_view SET ID = '{v_new_id}' WHERE ID = '{v_old_id}';") + plan.append(f"UPDATE mdb_view_columns SET view_id = '{v_new_id}' WHERE view_id = '{v_old_id}';") plan.append(f"UPDATE mdb_identifiers SET vid = '{v_new_id}' WHERE vid = '{v_old_id}';") - plan.append(f"UPDATE mdb_view_columns SET id = UUID(), view_id = '{v_new_id}' WHERE id = '{v_old_id}';") + for column in view.columns: + vc_old_id: int = column.id + vc_new_id: uuid = uuid.uuid4() + plan.append(f"UPDATE mdb_view_columns SET id = '{vc_new_id}' WHERE id = '{vc_old_id}';") for table in database.tables: tbl_old_id: int = table.id tbl_new_id: uuid = uuid.uuid4() @@ -192,8 +197,8 @@ def update_identifiers() -> None: f_old_id = funder.id f_new_id: uuid = uuid.uuid4() plan.append(f"UPDATE mdb_identifier_funders SET id = '{f_new_id}' WHERE id = '{f_old_id}';") - for funder in identifier.related: - r_old_id = funder.id + for related_identifier in identifier.related_identifiers: + r_old_id = related_identifier.id r_new_id: uuid = uuid.uuid4() plan.append(f"UPDATE mdb_identifier_related SET id = '{r_new_id}' WHERE id = '{r_old_id}';") plan.append("COMMIT;") diff --git a/dbrepo-ui/components/identifier/Summary.vue b/dbrepo-ui/components/identifier/Summary.vue index dcbe2f063db7ccbeb601a70a2d1bc85e3f9a5c85..a2df3f22c715b13a8a4f7c70e78e1a00ccc92bb1 100644 --- a/dbrepo-ui/components/identifier/Summary.vue +++ b/dbrepo-ui/components/identifier/Summary.vue @@ -68,7 +68,7 @@ </div> </v-list-item> <v-list-item - v-if="identifier.related_identifiers && identifier.related_identifiers.length > 0" + v-if="identifier.related_identifiers" :title="$t('pages.identifier.related-identifiers.title')" density="compact"> <p diff --git a/dbrepo-ui/composables/identifier-service.ts b/dbrepo-ui/composables/identifier-service.ts index 585356994be12526b4e7c83519a3f36db00b388a..2e96a2e20d68f2d4b381b3edd27ea8b25eea4c79 100644 --- a/dbrepo-ui/composables/identifier-service.ts +++ b/dbrepo-ui/composables/identifier-service.ts @@ -273,6 +273,9 @@ export const useIdentifierService = (): any => { const regex: RegExp = /(10[.][0-9]{4,}[^\s"\/<>]*\/[^\s"<>]+)/g const matches: RegExpMatchArray | null = val.match(regex) if (matches && matches.length > 0) { + if (config.public.doi.endpoint) { + return `${config.public.doi.endpoint}/${matches[0]}` + } return `https://doi.org/${matches[0]}` } if (val.startsWith('http')) { diff --git a/dbrepo-ui/nuxt.config.ts b/dbrepo-ui/nuxt.config.ts index 4d9b769904dec4c1291df21d7c2eb3235218407d..b3694d5b8bfdad9cc618cd5d0ff53e912c3ea3ec 100644 --- a/dbrepo-ui/nuxt.config.ts +++ b/dbrepo-ui/nuxt.config.ts @@ -98,7 +98,6 @@ export default defineNuxtConfig({ } }, doi: { - enabled: false, endpoint: 'https://doi.org' }, links: {}