Skip to content
Snippets Groups Projects
Commit 849b689f authored by Martin Weise's avatar Martin Weise
Browse files

fixed some tests

Former-commit-id: 993dc965
parent a12235fb
Branches
Tags
1 merge request!42Fixed the query service tests
Showing
with 207 additions and 51 deletions
package at.tuwien.api.zenodo.files;
import lombok.*;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FileUploadDto {
private String name;
}
package at.tuwien.endpoints; package at.tuwien.endpoints;
import at.tuwien.service.MetadataService; import at.tuwien.api.zenodo.files.FileResponseDto;
import at.tuwien.exception.MetadataDatabaseNotFoundException;
import at.tuwien.exception.ZenodoAuthenticationException;
import at.tuwien.service.FileService;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid;
import java.util.List;
@Log4j2 @Log4j2
@CrossOrigin(origins = "*") @CrossOrigin(origins = "*")
...@@ -13,13 +17,37 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,13 +17,37 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/database/{id}/table/{tableid}/file") @RequestMapping("/api/database/{id}/table/{tableid}/file")
public class FileEndpoint { public class FileEndpoint {
private final MetadataService citationService; private final FileService fileService;
@Autowired @Autowired
public FileEndpoint(MetadataService citationService) { public FileEndpoint(FileService fileService) {
this.citationService = citationService; this.fileService = fileService;
} }
@GetMapping
public List<FileResponseDto> listAll(@Valid @RequestParam("id") Long databaseId,
@Valid @RequestParam("tableId") Long tableId)
throws MetadataDatabaseNotFoundException, ZenodoAuthenticationException {
return fileService.listAll(databaseId, tableId);
}
// public FileResponseDto find(@Valid @RequestParam("id") Long databaseId,
// @Valid @RequestParam("tableId") Long tableId) {
//
// }
//
// public FileResponseDto create(@Valid @RequestParam("id") Long databaseId,
// @Valid @RequestParam("tableId") Long tableId) {
//
// }
//
// public FileResponseDto update(@Valid @RequestParam("id") Long databaseId,
// @Valid @RequestParam("tableId") Long tableId) {
//
// }
//
// public FileResponseDto delete(@Valid @RequestParam("id") Long databaseId,
// @Valid @RequestParam("tableId") Long tableId) {
//
// }
} }
...@@ -3,6 +3,8 @@ package at.tuwien; ...@@ -3,6 +3,8 @@ package at.tuwien;
import at.tuwien.api.zenodo.deposit.*; import at.tuwien.api.zenodo.deposit.*;
import at.tuwien.api.zenodo.files.FileResponseDto; import at.tuwien.api.zenodo.files.FileResponseDto;
import at.tuwien.api.zenodo.files.FileLinksDto; import at.tuwien.api.zenodo.files.FileLinksDto;
import at.tuwien.entities.database.Database;
import at.tuwien.entities.database.table.Table;
import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.RandomStringUtils;
import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.TestPropertySource;
...@@ -13,6 +15,10 @@ import java.util.List; ...@@ -13,6 +15,10 @@ import java.util.List;
@TestPropertySource(locations = "classpath:application.properties") @TestPropertySource(locations = "classpath:application.properties")
public abstract class BaseUnitTest { public abstract class BaseUnitTest {
public final static Long DATABASE_1_ID = 1L;
public final static Long TABLE_1_ID = 1L;
public final static Long DEPOSIT_1_ID = 1L; public final static Long DEPOSIT_1_ID = 1L;
public final static String DEPOSIT_1_TITLE = "Super cool document"; public final static String DEPOSIT_1_TITLE = "Super cool document";
public final static String DEPOSIT_1_DESCRIPTION = "My document is the best"; public final static String DEPOSIT_1_DESCRIPTION = "My document is the best";
...@@ -62,6 +68,16 @@ public abstract class BaseUnitTest { ...@@ -62,6 +68,16 @@ public abstract class BaseUnitTest {
public final static String DEPOSIT_1_DOI = "10.5072/zenodo.542201"; public final static String DEPOSIT_1_DOI = "10.5072/zenodo.542201";
public final static Long DEPOSIT_1_REC_ID = 542201L; public final static Long DEPOSIT_1_REC_ID = 542201L;
public final static Table TABLE_1 = Table.builder()
.id(TABLE_1_ID)
.depositId(DEPOSIT_1_ID)
.build();
public final static Database DATABASE_1 = Database.builder()
.id(DATABASE_1_ID)
.tables(List.of(TABLE_1))
.build();
public final static CreatorDto CREATOR_1 = CreatorDto.builder() public final static CreatorDto CREATOR_1 = CreatorDto.builder()
.name(CREATOR_1_NAME) .name(CREATOR_1_NAME)
.affiliation(CREATOR_1_AFFIL) .affiliation(CREATOR_1_AFFIL)
......
...@@ -3,11 +3,11 @@ package at.tuwien.service; ...@@ -3,11 +3,11 @@ package at.tuwien.service;
import at.tuwien.BaseUnitTest; import at.tuwien.BaseUnitTest;
import at.tuwien.api.zenodo.deposit.DepositChangeResponseDto; import at.tuwien.api.zenodo.deposit.DepositChangeResponseDto;
import at.tuwien.api.zenodo.files.FileResponseDto; import at.tuwien.api.zenodo.files.FileResponseDto;
import at.tuwien.api.zenodo.files.FileUploadDto;
import at.tuwien.config.ReadyConfig; import at.tuwien.config.ReadyConfig;
import at.tuwien.exception.ZenodoApiException; import at.tuwien.entities.database.table.Table;
import at.tuwien.exception.ZenodoAuthenticationException; import at.tuwien.exception.*;
import at.tuwien.exception.ZenodoFileTooLargeException; import at.tuwien.repository.jpa.TableRepository;
import at.tuwien.exception.ZenodoNotFoundException;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,8 +18,10 @@ import org.springframework.util.ResourceUtils; ...@@ -18,8 +18,10 @@ import org.springframework.util.ResourceUtils;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
@SpringBootTest @SpringBootTest
@ExtendWith(SpringExtension.class) @ExtendWith(SpringExtension.class)
...@@ -28,6 +30,9 @@ public class FileServiceIntegrationTest extends BaseUnitTest { ...@@ -28,6 +30,9 @@ public class FileServiceIntegrationTest extends BaseUnitTest {
@MockBean @MockBean
private ReadyConfig readyConfig; private ReadyConfig readyConfig;
@MockBean
private TableRepository tableRepository;
@Autowired @Autowired
private ZenodoFileService fileService; private ZenodoFileService fileService;
...@@ -36,12 +41,25 @@ public class FileServiceIntegrationTest extends BaseUnitTest { ...@@ -36,12 +41,25 @@ public class FileServiceIntegrationTest extends BaseUnitTest {
@Test @Test
public void createResource_succeeds() throws IOException, ZenodoApiException, ZenodoNotFoundException, public void createResource_succeeds() throws IOException, ZenodoApiException, ZenodoNotFoundException,
ZenodoAuthenticationException, ZenodoFileTooLargeException { ZenodoAuthenticationException, ZenodoFileTooLargeException, MetadataDatabaseNotFoundException {
final DepositChangeResponseDto deposit = metadataService.storeCitation();
final File file = ResourceUtils.getFile("classpath:csv/testdata.csv"); final File file = ResourceUtils.getFile("classpath:csv/testdata.csv");
/* request */
final DepositChangeResponseDto deposit = metadataService.storeCitation();
final FileUploadDto request = FileUploadDto.builder()
.name(FILE_1_NAME)
.build();
/* mock */
final Table TABLE_1 = Table.builder()
.id(TABLE_1_ID)
.depositId(deposit.getId())
.build();;
when(tableRepository.findById(TABLE_1_ID))
.thenReturn(Optional.of(TABLE_1));
/* test */ /* test */
final FileResponseDto response = fileService.createResource(deposit.getId(), FILE_1_NAME, file); final FileResponseDto response = fileService.createResource(DATABASE_1_ID, TABLE_1_ID, request, file);
assertEquals(FILE_1_NAME, response.getFilename()); assertEquals(FILE_1_NAME, response.getFilename());
assertEquals(FILE_1_CHECKSUM, response.getChecksum()); assertEquals(FILE_1_CHECKSUM, response.getChecksum());
assertEquals(FILE_1_SIZE, response.getFilesize()); assertEquals(FILE_1_SIZE, response.getFilesize());
...@@ -49,12 +67,25 @@ public class FileServiceIntegrationTest extends BaseUnitTest { ...@@ -49,12 +67,25 @@ public class FileServiceIntegrationTest extends BaseUnitTest {
@Test @Test
public void createResource_largeFile_succeeds() throws IOException, ZenodoApiException, ZenodoNotFoundException, public void createResource_largeFile_succeeds() throws IOException, ZenodoApiException, ZenodoNotFoundException,
ZenodoAuthenticationException, ZenodoFileTooLargeException { ZenodoAuthenticationException, ZenodoFileTooLargeException, MetadataDatabaseNotFoundException {
final DepositChangeResponseDto deposit = metadataService.storeCitation();
final File file = ResourceUtils.getFile("classpath:csv/weatherAUS.csv"); final File file = ResourceUtils.getFile("classpath:csv/weatherAUS.csv");
/* request */
final DepositChangeResponseDto deposit = metadataService.storeCitation();
final FileUploadDto request = FileUploadDto.builder()
.name(FILE_2_NAME)
.build();
/* mock */
final Table TABLE_1 = Table.builder()
.id(TABLE_1_ID)
.depositId(deposit.getId())
.build();
when(tableRepository.findById(TABLE_1_ID))
.thenReturn(Optional.of(TABLE_1));
/* test */ /* test */
final FileResponseDto response = fileService.createResource(deposit.getId(), FILE_2_NAME, file); final FileResponseDto response = fileService.createResource(DATABASE_1_ID, TABLE_1_ID, request, file);
assertEquals(FILE_2_NAME, response.getFilename()); assertEquals(FILE_2_NAME, response.getFilename());
assertEquals(FILE_2_CHECKSUM, response.getChecksum()); assertEquals(FILE_2_CHECKSUM, response.getChecksum());
assertEquals(FILE_2_SIZE, response.getFilesize()); assertEquals(FILE_2_SIZE, response.getFilesize());
......
...@@ -2,11 +2,10 @@ package at.tuwien.service; ...@@ -2,11 +2,10 @@ package at.tuwien.service;
import at.tuwien.BaseUnitTest; import at.tuwien.BaseUnitTest;
import at.tuwien.api.zenodo.files.FileResponseDto; import at.tuwien.api.zenodo.files.FileResponseDto;
import at.tuwien.api.zenodo.files.FileUploadDto;
import at.tuwien.config.ReadyConfig; import at.tuwien.config.ReadyConfig;
import at.tuwien.exception.ZenodoApiException; import at.tuwien.exception.*;
import at.tuwien.exception.ZenodoAuthenticationException; import at.tuwien.repository.jpa.TableRepository;
import at.tuwien.exception.ZenodoFileTooLargeException;
import at.tuwien.exception.ZenodoNotFoundException;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito; import org.mockito.Mockito;
...@@ -24,6 +23,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -24,6 +23,7 @@ import org.springframework.web.client.RestTemplate;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
...@@ -45,21 +45,29 @@ public class FileServiceUnitTest extends BaseUnitTest { ...@@ -45,21 +45,29 @@ public class FileServiceUnitTest extends BaseUnitTest {
@MockBean @MockBean
private RestTemplate apiTemplate; private RestTemplate apiTemplate;
@MockBean
private TableRepository tableRepository;
@Test @Test
public void createResource_succeeds() throws IOException, ZenodoApiException, ZenodoNotFoundException, public void createResource_succeeds() throws IOException, ZenodoApiException, ZenodoNotFoundException,
ZenodoAuthenticationException, ZenodoFileTooLargeException { ZenodoAuthenticationException, ZenodoFileTooLargeException, MetadataDatabaseNotFoundException {
final File file = ResourceUtils.getFile("classpath:csv/testdata.csv");
/* mock */ /* mock */
when(apiTemplate.postForEntity(anyString(), Mockito.<MultiValueMap<String, HttpEntity<?>>>any(), when(apiTemplate.postForEntity(anyString(), Mockito.<MultiValueMap<String, HttpEntity<?>>>any(),
eq(FileResponseDto.class), anyLong(), anyString())) eq(FileResponseDto.class), eq(DEPOSIT_1_ID), anyString()))
.thenReturn(ResponseEntity.status(HttpStatus.OK) .thenReturn(ResponseEntity.status(HttpStatus.OK)
.body(FILE_1)); .body(FILE_1));
when(tableRepository.findById(TABLE_1_ID))
.thenReturn(Optional.of(TABLE_1));
/* request */ /* request */
final File file = ResourceUtils.getFile("classpath:csv/testdata.csv"); final FileUploadDto request = FileUploadDto.builder()
.name(FILE_1_NAME)
.build();
/* test */ /* test */
final FileResponseDto response = fileService.createResource(DEPOSIT_1_ID, FILE_1_NAME, file); final FileResponseDto response = fileService.createResource(DATABASE_1_ID, TABLE_1_ID, request, file);
assertEquals(FILE_1_NAME, response.getFilename()); assertEquals(FILE_1_NAME, response.getFilename());
assertEquals(FILE_1_CHECKSUM, response.getChecksum()); assertEquals(FILE_1_CHECKSUM, response.getChecksum());
assertEquals(FILE_1_SIZE, response.getFilesize()); assertEquals(FILE_1_SIZE, response.getFilesize());
...@@ -67,19 +75,24 @@ public class FileServiceUnitTest extends BaseUnitTest { ...@@ -67,19 +75,24 @@ public class FileServiceUnitTest extends BaseUnitTest {
@Test @Test
public void createResource_notExists_fails() throws IOException { public void createResource_notExists_fails() throws IOException {
final File file = ResourceUtils.getFile("classpath:csv/testdata.csv");
/* mock */ /* mock */
when(apiTemplate.postForEntity(anyString(), Mockito.<MultiValueMap<String, HttpEntity<?>>>any(), when(apiTemplate.postForEntity(anyString(), Mockito.<MultiValueMap<String, HttpEntity<?>>>any(),
eq(FileResponseDto.class), anyLong(), anyString())) eq(FileResponseDto.class), eq(DEPOSIT_1_ID), anyString()))
.thenReturn(ResponseEntity.status(HttpStatus.BAD_REQUEST) .thenReturn(ResponseEntity.status(HttpStatus.BAD_REQUEST)
.build()); .build());
when(tableRepository.findById(TABLE_1_ID))
.thenReturn(Optional.of(TABLE_1));
/* request */ /* request */
final File file = ResourceUtils.getFile("classpath:csv/testdata.csv"); final FileUploadDto request = FileUploadDto.builder()
.name(FILE_1_NAME)
.build();
/* test */ /* test */
assertThrows(ZenodoNotFoundException.class, () -> { assertThrows(ZenodoNotFoundException.class, () -> {
fileService.createResource(DEPOSIT_1_ID, FILE_1_NAME, file); fileService.createResource(DATABASE_1_ID, TABLE_1_ID, request, file);
}); });
} }
......
#!/bin/bash #!/bin/bash
docker pull mariadb:latest
docker pull mysql:latest
docker pull postgres:latest
\ No newline at end of file
package at.tuwien.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(code = HttpStatus.NOT_FOUND)
public class MetadataDatabaseNotFoundException extends Exception {
public MetadataDatabaseNotFoundException(String msg) {
super(msg);
}
public MetadataDatabaseNotFoundException(String msg, Throwable thr) {
super(msg, thr);
}
public MetadataDatabaseNotFoundException(Throwable thr) {
super(thr);
}
}
package at.tuwien.service; package at.tuwien.service;
import at.tuwien.api.zenodo.files.FileResponseDto; import at.tuwien.api.zenodo.files.FileResponseDto;
import at.tuwien.exception.ZenodoApiException; import at.tuwien.api.zenodo.files.FileUploadDto;
import at.tuwien.exception.ZenodoAuthenticationException; import at.tuwien.exception.*;
import at.tuwien.exception.ZenodoFileTooLargeException;
import at.tuwien.exception.ZenodoNotFoundException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.File; import java.io.File;
import java.util.List;
@Service @Service
public interface FileService { public interface FileService {
FileResponseDto createResource(Long id, String name, File resource) FileResponseDto createResource(Long databaseId, Long tableId, FileUploadDto data, File resource)
throws ZenodoAuthenticationException, ZenodoApiException, ZenodoNotFoundException, throws ZenodoAuthenticationException, ZenodoApiException, ZenodoNotFoundException,
ZenodoFileTooLargeException; ZenodoFileTooLargeException, MetadataDatabaseNotFoundException;
List<FileResponseDto> listAll(Long databaseId, Long tableId) throws MetadataDatabaseNotFoundException, ZenodoAuthenticationException;
} }
package at.tuwien.service; package at.tuwien.service;
import at.tuwien.api.zenodo.files.FileResponseDto; import at.tuwien.api.zenodo.files.FileResponseDto;
import at.tuwien.api.zenodo.files.FileUploadDto;
import at.tuwien.config.ZenodoConfig; import at.tuwien.config.ZenodoConfig;
import at.tuwien.exception.ZenodoApiException; import at.tuwien.entities.database.table.Table;
import at.tuwien.exception.ZenodoAuthenticationException; import at.tuwien.exception.*;
import at.tuwien.exception.ZenodoFileTooLargeException;
import at.tuwien.exception.ZenodoNotFoundException;
import at.tuwien.mapper.ZenodoMapper; import at.tuwien.mapper.ZenodoMapper;
import at.tuwien.repository.jpa.TableRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -15,35 +15,37 @@ import org.springframework.web.client.RestTemplate; ...@@ -15,35 +15,37 @@ import org.springframework.web.client.RestTemplate;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Optional;
@Service @Service
public class ZenodoFileService implements FileService { public class ZenodoFileService implements FileService {
private final RestTemplate apiTemplate; private final RestTemplate apiTemplate;
private final RestTemplate uploadTemplate;
private final ZenodoConfig zenodoConfig; private final ZenodoConfig zenodoConfig;
private final ZenodoMapper zenodoMapper; private final ZenodoMapper zenodoMapper;
private final TableRepository tableRepository;
@Autowired @Autowired
public ZenodoFileService(RestTemplate apiTemplate, RestTemplate uploadTemplate, ZenodoConfig zenodoConfig, public ZenodoFileService(RestTemplate apiTemplate, ZenodoConfig zenodoConfig, ZenodoMapper zenodoMapper,
ZenodoMapper zenodoMapper) { TableRepository tableRepository) {
this.apiTemplate = apiTemplate; this.apiTemplate = apiTemplate;
this.uploadTemplate = uploadTemplate;
this.zenodoConfig = zenodoConfig; this.zenodoConfig = zenodoConfig;
this.zenodoMapper = zenodoMapper; this.zenodoMapper = zenodoMapper;
this.tableRepository = tableRepository;
} }
@Override @Override
public FileResponseDto createResource(Long id, String name, File resource) public FileResponseDto createResource(Long databaseId, Long tableId, FileUploadDto data, File resource)
throws ZenodoAuthenticationException, ZenodoApiException, ZenodoNotFoundException, throws ZenodoAuthenticationException, ZenodoApiException, ZenodoNotFoundException,
ZenodoFileTooLargeException { ZenodoFileTooLargeException, MetadataDatabaseNotFoundException {
if (resource.getTotalSpace() > 50_1000_1000_1000L) { if (resource.getTotalSpace() > 50_1000_1000_1000L) {
throw new ZenodoFileTooLargeException("Only 50GB per file is allowed!"); throw new ZenodoFileTooLargeException("Only 50GB per file is allowed!");
} }
final Table table = getTable(tableId);
final ResponseEntity<FileResponseDto> response; final ResponseEntity<FileResponseDto> response;
try { try {
response = uploadTemplate.postForEntity("/api/deposit/depositions/{deposit_id}/files?access_token={token}", response = apiTemplate.postForEntity("/api/deposit/depositions/{deposit_id}/files?access_token={token}",
zenodoMapper.resourceToHttpEntity(name, resource), FileResponseDto.class, id, zenodoConfig.getApiKey()); zenodoMapper.resourceToHttpEntity(data.getName(), resource), FileResponseDto.class, table.getDepositId(), zenodoConfig.getApiKey());
} catch (IOException e) { } catch (IOException e) {
throw new ZenodoApiException("Could not map file to byte array"); throw new ZenodoApiException("Could not map file to byte array");
} }
...@@ -59,4 +61,28 @@ public class ZenodoFileService implements FileService { ...@@ -59,4 +61,28 @@ public class ZenodoFileService implements FileService {
return response.getBody(); return response.getBody();
} }
@Override
public List<FileResponseDto> listAll(Long databaseId, Long tableId) throws MetadataDatabaseNotFoundException,
ZenodoAuthenticationException {
// final Table table = getTable(tableId);
// final ResponseEntity<FileResponseDto> response = apiTemplate.postForEntity("/api/deposit/depositions/{deposit_id}/files?access_token={token}",
// addHeaders(null), FileResponseDto.class, table.getDepositId(), zenodoConfig.getApiKey());
return List.of();
}
private Table getTable(Long tableId) throws MetadataDatabaseNotFoundException {
final Optional<Table> table = tableRepository.findById(tableId);
if (table.isEmpty()) {
throw new MetadataDatabaseNotFoundException("Failed to find table with this id");
}
return table.get();
}
private HttpEntity<Object> addHeaders(Object body) {
final HttpHeaders headers = new HttpHeaders();
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
headers.setContentType(MediaType.APPLICATION_JSON);
return new HttpEntity<>(body, headers);
}
} }
...@@ -20,6 +20,10 @@ public class TableDto { ...@@ -20,6 +20,10 @@ public class TableDto {
@ApiModelProperty(name = "table id", example = "1") @ApiModelProperty(name = "table id", example = "1")
private Long id; private Long id;
@NotNull
@ApiModelProperty(name = "deposition id", example = "100")
private Long depositId;
@NotBlank @NotBlank
@ApiModelProperty(name = "table name", example = "Weather Australia") @ApiModelProperty(name = "table name", example = "Weather Australia")
private String name; private String name;
......
...@@ -40,6 +40,10 @@ public class Table { ...@@ -40,6 +40,10 @@ public class Table {
@ToString.Include @ToString.Include
private Long tdbid; private Long tdbid;
@ToString.Include
@Column(nullable = true, name = "depId")
private Long depositId;
@ToString.Include @ToString.Include
@Column(nullable = false, name = "tname") @Column(nullable = false, name = "tname")
private String name; private String name;
......
...@@ -192,6 +192,7 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E ...@@ -192,6 +192,7 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
internal_name character varying(255) NOT NULL, internal_name character varying(255) NOT NULL,
topic character varying(255) NOT NULL, topic character varying(255) NOT NULL,
last_modified timestamp without time zone, last_modified timestamp without time zone,
depId bigint UNIQUE,
tName VARCHAR(50), tName VARCHAR(50),
tDescription TEXT, tDescription TEXT,
NumCols INTEGER, NumCols INTEGER,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment