Skip to content
Snippets Groups Projects
Verified Commit 5cdbf4df authored by Martin Weise's avatar Martin Weise
Browse files

Hotfix deletion of views

parent ffdd7a70
No related branches found
No related tags found
1 merge request!331Hotfix deletion of views
......@@ -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;
......
......@@ -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"})
......
......@@ -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) {
......
......@@ -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
......
......@@ -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') }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment