Skip to content

Commit

Permalink
34838 Replace ContainerType by storage-unit-usage
Browse files Browse the repository at this point in the history
Replaced well row col by storage-unit-usage
  • Loading branch information
cgendreau committed Aug 30, 2024
1 parent 81eb776 commit 3b0dfe3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/main/java/ca/gc/aafc/seqdb/api/dto/LibraryPrepDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class LibraryPrepDto {

private String size;

private Integer wellColumn;

private String wellRow;
@JsonApiExternalRelation(type = "storage-unit-usage")
@JsonApiRelation
private ExternalRelationDto storageUnitUsage;

@JsonApiRelation
private LibraryPrepBatchDto libraryPrepBatch;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package ca.gc.aafc.seqdb.api.entities.libraryprep;

import org.hibernate.annotations.NaturalId;

import ca.gc.aafc.dina.entity.DinaEntity;

import java.time.OffsetDateTime;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
Expand All @@ -12,15 +15,8 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.annotations.NaturalId;

import ca.gc.aafc.dina.entity.DinaEntity;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down Expand Up @@ -53,18 +49,14 @@ public class LibraryPrep implements DinaEntity {

private String size;

@Min(value = 1)
private Integer wellColumn;

@Size(max = 2)
@Pattern(regexp = "[a-zA-Z]")
private String wellRow;

@NotNull
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "libraryprepbatchid")
private LibraryPrepBatch libraryPrepBatch;


@Column(name = "storage_unit_usage")
private UUID storageUnitUsage;

@NotNull
@Column(name = "material_sample")
private UUID materialSample;
Expand All @@ -81,5 +73,4 @@ public class LibraryPrep implements DinaEntity {
@Column(name = "_group")
private String group;


}
1 change: 1 addition & 0 deletions src/main/resources/db/changelog/db.changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@
<include file="db/changelog/migrations/43-Change_PcrBatchItem_to_use_StorageUnitUsage.xml"/>
<include file="db/changelog/migrations/44-Change_SeqReaction_to_use_StorageUnitUsage.xml"/>
<include file="db/changelog/migrations/45-Remove_legacy_storage_related_fields.xml"/>
<include file="db/changelog/migrations/46-Change_LibraryPrep_to_use_StorageUnitUsage.xml"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://local.xsd/dbchangelog-4.4.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">

<changeSet id="46-Change_LibraryPrep_to_use_StorageUnitUsage" context="schema-change" author="cgendreau">
<dropColumn tableName="librarypreps">
<column name="wellcolumn"/>
<column name="wellrow"/>
</dropColumn>
<addColumn tableName="librarypreps">
<column name="storage_unit_usage" type="uuid"/>
</addColumn>
</changeSet>
</databaseChangeLog>

0 comments on commit 3b0dfe3

Please sign in to comment.