ENT-10122: Made the consuming tx id field nullable, added missing changelog file.

This commit is contained in:
Adel El-Beik 2023-07-18 17:45:53 +01:00
parent 669d6590af
commit 60bb4c58f2
3 changed files with 18 additions and 3 deletions

View File

@ -231,7 +231,7 @@ class NodeVaultService(
if (stateStatus != Vault.StateStatus.CONSUMED) {
stateStatus = Vault.StateStatus.CONSUMED
consumedTime = clock.instant()
consumingTxId = update.consumingTxIds[stateRef]?.toString() ?: ""
consumingTxId = update.consumingTxIds[stateRef]?.toString()
// remove lock (if held)
if (lockId != null) {
lockId = null

View File

@ -94,8 +94,8 @@ object VaultSchemaV1 : MappedSchema(
var constraintData: ByteArray? = null,
/** consuming transaction */
@Column(name = "consuming_tx_id", length = 144, nullable = false)
var consumingTxId: String = ""
@Column(name = "consuming_tx_id", length = 144, nullable = true)
var consumingTxId: String? = null
) : PersistentState()
@Entity

View File

@ -0,0 +1,15 @@
<?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 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
<changeSet author="R3.Corda" id="add_consuming_tx_id_column">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="vault_states" columnName="consuming_tx_id"/>
</not>
</preConditions>
<addColumn tableName="vault_states">
<column name="consuming_tx_id" type="NVARCHAR(144)"/>
</addColumn>
</changeSet>
</databaseChangeLog>