Skip to content

Commit

Permalink
Set Unique-Constraints for thumbprint in SignerInformation and Truste…
Browse files Browse the repository at this point in the history
…dParty (#92)

Update Liquibase Snapshot
  • Loading branch information
f11h authored Jun 28, 2021
1 parent 4572aeb commit 56686d9
Show file tree
Hide file tree
Showing 5 changed files with 336 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class SignerInformationEntity {
/**
* SHA-256 Thumbprint of the certificate (hex encoded).
*/
@Column(name = "thumbprint", nullable = false, length = 64)
@Column(name = "thumbprint", nullable = false, length = 64, unique = true)
private String thumbprint;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class TrustedPartyEntity {
/**
* SHA-256 Thumbprint of the certificate (hex encoded).
*/
@Column(name = "thumbprint", nullable = false, length = 64)
@Column(name = "thumbprint", nullable = false, length = 64, unique = true)
private String thumbprint;

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<include file="db/changelog/add-valueset-table.xml"/>
<include file="db/changelog/increase-column-size-for-valueset.xml"/>
<include file="db/changelog/add-validation-rule-table.xml"/>
<include file="db/changelog/add-unique-constraints.xml"/>
</databaseChangeLog>
16 changes: 16 additions & 0 deletions src/main/resources/db/changelog/add-unique-constraints.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<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
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
<changeSet id="1624886185120-2" author="f11h">
<addUniqueConstraint columnNames="thumbprint" constraintName="UC_TRUSTED_PARTY_THUMBPRINT"
tableName="trusted_party"/>

<addUniqueConstraint columnNames="thumbprint" constraintName="UC_SIGNER_INFORMATION_THUMBPRINT"
tableName="signer_information"/>
</changeSet>

</databaseChangeLog>
Loading

0 comments on commit 56686d9

Please sign in to comment.