diff --git a/dbrepo-metadata-db/1_setup-schema.sql b/dbrepo-metadata-db/1_setup-schema.sql index d52cb4cae88dffa827432d0e0befee8e273589e8..b6b3b7bf89a8140950f1bf11768911bcc9fb6977 100644 --- a/dbrepo-metadata-db/1_setup-schema.sql +++ b/dbrepo-metadata-db/1_setup-schema.sql @@ -369,7 +369,7 @@ CREATE TABLE IF NOT EXISTS `mdb_view_columns` d BIGINT UNSIGNED, is_null_allowed BOOLEAN NOT NULL DEFAULT true, PRIMARY KEY (id), - FOREIGN KEY (view_id) REFERENCES mdb_view (id), + FOREIGN KEY (view_id) REFERENCES mdb_view (id) ON DELETE CASCADE, UNIQUE (view_id, internal_name) ) WITH SYSTEM VERSIONING; diff --git a/dbrepo-metadata-service/entities/src/main/java/at/tuwien/entities/database/ViewColumn.java b/dbrepo-metadata-service/entities/src/main/java/at/tuwien/entities/database/ViewColumn.java index 5016630500cc2b792cacc5df8ec5e58c8ca610b4..10ac29d8e65eaa15ba592919ac014e452a87a06a 100644 --- a/dbrepo-metadata-service/entities/src/main/java/at/tuwien/entities/database/ViewColumn.java +++ b/dbrepo-metadata-service/entities/src/main/java/at/tuwien/entities/database/ViewColumn.java @@ -12,6 +12,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; @ToString @AllArgsConstructor @NoArgsConstructor +@EqualsAndHashCode(onlyExplicitlyIncluded = true) @EntityListeners(AuditingEntityListener.class) @jakarta.persistence.Table(name = "mdb_view_columns", uniqueConstraints = { @UniqueConstraint(columnNames = {"view_id", "internal_name"}) diff --git a/dbrepo-metadata-service/rest-service/src/test/java/at/tuwien/service/ViewServicePersistenceTest.java b/dbrepo-metadata-service/rest-service/src/test/java/at/tuwien/service/ViewServicePersistenceTest.java index 68eca349672106870801561689f26d02b18916e6..8ca002472a085a58ea5ee58fff8a2a0614c94fd9 100644 --- a/dbrepo-metadata-service/rest-service/src/test/java/at/tuwien/service/ViewServicePersistenceTest.java +++ b/dbrepo-metadata-service/rest-service/src/test/java/at/tuwien/service/ViewServicePersistenceTest.java @@ -25,6 +25,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.when; @@ -92,6 +93,9 @@ public class ViewServicePersistenceTest extends AbstractUnitTest { /* test */ viewService.delete(VIEW_1); + assertThrows(ViewNotFoundException.class, () -> { + viewService.findById(DATABASE_1, VIEW_1_ID); + }); } } diff --git a/dbrepo-metadata-service/services/src/main/java/at/tuwien/gateway/impl/DataServiceGatewayImpl.java b/dbrepo-metadata-service/services/src/main/java/at/tuwien/gateway/impl/DataServiceGatewayImpl.java index 0c11de442957cbc6deee1d20d7f51b865017a90b..709537862a77b5bb6bccb5be4cae5d26f5622121 100644 --- a/dbrepo-metadata-service/services/src/main/java/at/tuwien/gateway/impl/DataServiceGatewayImpl.java +++ b/dbrepo-metadata-service/services/src/main/java/at/tuwien/gateway/impl/DataServiceGatewayImpl.java @@ -214,7 +214,7 @@ public class DataServiceGatewayImpl implements DataServiceGateway { public ViewDto createView(Long databaseId, ViewCreateDto data) throws DataServiceConnectionException, DataServiceException { final ResponseEntity<ViewDto> response; final String path = "/api/database/" + databaseId + "/view"; - log.trace("delete table at endpoint {} with path {}", gatewayConfig.getDataEndpoint(), path); + log.trace("create view at endpoint {} with path {}", gatewayConfig.getDataEndpoint(), path); try { response = restTemplate.exchange(path, HttpMethod.POST, new HttpEntity<>(data), ViewDto.class); } catch (HttpServerErrorException e) { @@ -264,6 +264,7 @@ public class DataServiceGatewayImpl implements DataServiceGateway { QueryNotFoundException { final ResponseEntity<QueryDto> response; final String path = "/api/database/" + databaseId + "/subset/" + queryId; + log.trace("find subset at endpoint {} with path {}", gatewayConfig.getDataEndpoint(), path); try { response = restTemplate.exchange(path, HttpMethod.GET, HttpEntity.EMPTY, QueryDto.class); } catch (HttpServerErrorException e) { @@ -291,6 +292,7 @@ public class DataServiceGatewayImpl implements DataServiceGateway { DataServiceException, QueryNotFoundException { final ResponseEntity<ExportResourceDto> response; final String path = "/api/database/" + databaseId + "/subset/" + queryId; + log.trace("export subset at endpoint {} with path {}", gatewayConfig.getDataEndpoint(), path); try { response = restTemplate.exchange(path, HttpMethod.GET, HttpEntity.EMPTY, ExportResourceDto.class); } catch (HttpServerErrorException e) { @@ -315,6 +317,7 @@ public class DataServiceGatewayImpl implements DataServiceGateway { TableNotFoundException { final ResponseEntity<TableDto[]> response; final String path = "/api/database/" + databaseId + "/table"; + log.trace("get table schemas at endpoint {} with path {}", gatewayConfig.getDataEndpoint(), path); try { response = restTemplate.exchange(path, HttpMethod.GET, HttpEntity.EMPTY, TableDto[].class); } catch (HttpServerErrorException e) { diff --git a/dbrepo-ui/pages/index.vue b/dbrepo-ui/pages/index.vue index 93c48e189938bd75ff9c93c956163de0a18379ca..037f5b9410f316cce4e24ec2a9d45c6d6615a741 100644 --- a/dbrepo-ui/pages/index.vue +++ b/dbrepo-ui/pages/index.vue @@ -11,7 +11,7 @@ prepend-icon="mdi-plus" variant="flat" :text="$t('toolbars.database.create.text')" - color="primary" + color="secondary" @click.stop="dialog = true" /> </v-toolbar> <DatabaseList diff --git a/dbrepo-ui/pages/search.vue b/dbrepo-ui/pages/search.vue index b2d0f0219515530ac47b84342c66561ba117a288..ebe16ecec1c159de639a6c735b8f806dda1da21f 100644 --- a/dbrepo-ui/pages/search.vue +++ b/dbrepo-ui/pages/search.vue @@ -10,7 +10,7 @@ v-if="canCreateDatabase" class="mr-4" prepend-icon="mdi-plus" - color="primary" + color="secondary" variant="flat" @click.stop="createDbDialog = true"> {{ $t('toolbars.database.create.text') }} diff --git a/helm/dbrepo/files/system.json b/helm/dbrepo/files/system.json index c829e57d1a89633d70771c811843511dd9801358..52bf6d067122e2e803d2858256bfb274351d1f49 100644 --- a/helm/dbrepo/files/system.json +++ b/helm/dbrepo/files/system.json @@ -1292,7 +1292,7 @@ { "matcher": { "id": "byName", - "options": "auth-service:8080" + "options": "auth-service:9000" }, "properties": [ { @@ -1442,10 +1442,6 @@ { "color": "green", "value": null - }, - { - "color": "red", - "value": 80 } ] }, @@ -1455,7 +1451,7 @@ { "matcher": { "id": "byName", - "options": "auth-service:8080" + "options": "auth-service:9000" }, "properties": [ { @@ -1803,7 +1799,7 @@ "type": "timeseries" } ], - "refresh": "5s", + "refresh": "1m", "schemaVersion": 39, "tags": [ "provisioned",