From 0c646ff66228595648aff52fa9bba39506f20395 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Tue, 9 Jan 2018 14:44:17 +0000 Subject: [PATCH] [ENT-1339]: for h2, allow schemas without migrations to run (#294) (#305) * [ENT-1339]: for h2, allow schemas without migrations to run (#294) * [ENT-1339]: for h2, allow schemas without migrations to run * [ENT-1339]: fix various migration issues and change author name * [ENT-1339]: add naming convention for migrations * [ENT-1339]: change naming convention to use hyphens * [ENT-1339]: change mapping of participants to be able to control the table name * [ENT-1339]: change FK names to <=30 for oracle 11g compatibility * [ENT-1339]: cmd line argument for migrations made consistent * [ENT-1339]: revert abstract state superclasses * Update db integration test setup - new tables. * Update db integration test setup - new tables. * [ENT-1339]: remove final from participants to allow table name config * [ENT-1339]: shortened pk * [ENT-1339]: revert constructor * [ENT-1339]: change getMigrationResource api to Nullable --- .ci/api-current.txt | 10 +- .../core/internal/schemas/NodeInfoSchema.kt | 12 +- .../net/corda/core/schemas/CommonSchema.kt | 16 +- .../net/corda/core/schemas/PersistentTypes.kt | 25 +- .../database/postgresql/scripts/create-db.sql | 32 --- .../database/sqlserver/scripts/create-db.sql | 32 --- .../migration/cash.changelog-init.xml | 8 +- .../commercial-paper.changelog-init.xml | 10 +- .../sampleschemas/SampleCashSchemaV2.kt | 13 +- .../sampleschemas/SampleCashSchemaV3.kt | 2 +- .../SampleCommercialPaperSchemaV2.kt | 13 +- .../sample-cash-v1.changelog-init.xml | 8 +- .../sample-cash-v2.changelog-init.xml | 18 +- .../sample-cash-v3.changelog-init.xml | 12 +- .../migration/sample-cp-v1.changelog-init.xml | 4 +- .../migration/sample-cp-v2.changelog-init.xml | 17 +- .../common/persistence/PersistenceUtils.kt | 2 +- .../entity/CertificateSigningRequestEntity.kt | 2 +- .../network-manager.changelog-init.xml | 83 +++--- .../internal/persistence/CordaPersistence.kt | 2 + .../persistence/HibernateConfiguration.kt | 5 +- .../internal/persistence/SchemaMigration.kt | 19 +- .../message-schema.changelog-init.xml | 2 +- .../main/kotlin/net/corda/node/ArgsParser.kt | 2 +- .../net/corda/node/internal/AbstractNode.kt | 21 +- .../corda/node/services/vault/VaultSchema.kt | 6 +- .../database/postgresql/scripts/create-db.sql | 238 ------------------ .../database/sqlserver/scripts/create-db.sql | 236 ----------------- .../migration/common.changelog-init.xml | 20 +- .../migration/node-info.changelog-init.xml | 24 +- .../node-services.changelog-init.xml | 70 +++--- .../migration/vault-schema.changelog-init.xml | 40 ++- .../migration/test.changelog-init.xml | 4 +- .../migration/cash-pt.changelog-init.xml | 8 +- .../commercial-paper-pt.changelog-init.xml | 10 +- .../internal/vault/DummyDealContract.kt | 2 +- .../internal/vault/DummyDealStateSchemaV1.kt | 16 +- .../internal/vault/DummyLinearContract.kt | 2 +- .../vault/DummyLinearStateSchemaV1.kt | 3 +- .../vault/DummyLinearStateSchemaV2.kt | 18 +- .../azure-sql/db-global-cleanup.sql | 6 + .../database-scripts/azure-sql/db-setup.sql | 6 + .../db-global-cleanup.sql | 6 + .../db-global-setup.sql | 6 + .../sql-server-no-default-schema/db-setup.sql | 6 + .../sql-server/db-global-cleanup.sql | 6 + .../sql-server/db-global-setup.sql | 6 + .../database-scripts/sql-server/db-setup.sql | 6 + .../migration/dummy-deal.changelog-init.xml | 22 +- .../dummy-linear-v1.changelog-init.xml | 18 +- .../dummy-linear-v2.changelog-init.xml | 18 +- 51 files changed, 400 insertions(+), 773 deletions(-) delete mode 100644 finance/src/main/resources/database/postgresql/scripts/create-db.sql delete mode 100644 finance/src/main/resources/database/sqlserver/scripts/create-db.sql delete mode 100644 node/src/main/resources/database/postgresql/scripts/create-db.sql delete mode 100644 node/src/main/resources/database/sqlserver/scripts/create-db.sql diff --git a/.ci/api-current.txt b/.ci/api-current.txt index 8a98f07116..835248f562 100644 --- a/.ci/api-current.txt +++ b/.ci/api-current.txt @@ -2654,12 +2654,12 @@ public final class net.corda.core.schemas.CommonSchemaV1 extends net.corda.core. @org.jetbrains.annotations.NotNull public final net.corda.core.identity.AbstractParty getIssuer() @org.jetbrains.annotations.NotNull public final byte[] getIssuerRef() @org.jetbrains.annotations.NotNull public final net.corda.core.identity.AbstractParty getOwner() - @org.jetbrains.annotations.Nullable public final Set getParticipants() + @org.jetbrains.annotations.Nullable public Set getParticipants() public final long getQuantity() public final void setIssuer(net.corda.core.identity.AbstractParty) public final void setIssuerRef(byte[]) public final void setOwner(net.corda.core.identity.AbstractParty) - public final void setParticipants(Set) + public void setParticipants(Set) public final void setQuantity(long) ## @javax.persistence.MappedSuperclass @net.corda.core.serialization.CordaSerializable public static class net.corda.core.schemas.CommonSchemaV1$LinearState extends net.corda.core.schemas.PersistentState @@ -2667,10 +2667,10 @@ public final class net.corda.core.schemas.CommonSchemaV1 extends net.corda.core. public (Set, String, UUID) public (net.corda.core.contracts.UniqueIdentifier, Set) @org.jetbrains.annotations.Nullable public final String getExternalId() - @org.jetbrains.annotations.Nullable public final Set getParticipants() + @org.jetbrains.annotations.Nullable public Set getParticipants() @org.jetbrains.annotations.NotNull public final UUID getUuid() public final void setExternalId(String) - public final void setParticipants(Set) + public void setParticipants(Set) public final void setUuid(UUID) ## public class net.corda.core.schemas.MappedSchema extends java.lang.Object @@ -2703,7 +2703,7 @@ public class net.corda.core.schemas.MappedSchema extends java.lang.Object public String toString() ## public final class net.corda.core.schemas.PersistentTypesKt extends java.lang.Object - @org.jetbrains.annotations.NotNull public static final String getMigrationResource(net.corda.core.schemas.MappedSchema) + @org.jetbrains.annotations.Nullable public static final String getMigrationResource(net.corda.core.schemas.MappedSchema) ## @net.corda.core.serialization.CordaSerializable public interface net.corda.core.schemas.QueryableState extends net.corda.core.contracts.ContractState @org.jetbrains.annotations.NotNull public abstract net.corda.core.schemas.PersistentState generateMappedObject(net.corda.core.schemas.MappedSchema) diff --git a/core/src/main/kotlin/net/corda/core/internal/schemas/NodeInfoSchema.kt b/core/src/main/kotlin/net/corda/core/internal/schemas/NodeInfoSchema.kt index 10a630f610..1d08af2759 100644 --- a/core/src/main/kotlin/net/corda/core/internal/schemas/NodeInfoSchema.kt +++ b/core/src/main/kotlin/net/corda/core/internal/schemas/NodeInfoSchema.kt @@ -30,19 +30,19 @@ object NodeInfoSchemaV1 : MappedSchema( @Column(name = "node_info_id") var id: Int, - @Column(name="node_info_hash", length = 64) + @Column(name = "node_info_hash", length = 64) val hash: String, @Column(name = "addresses") @OneToMany(cascade = arrayOf(CascadeType.ALL), orphanRemoval = true) - @JoinColumn(name = "node_info_id") + @JoinColumn(name = "node_info_id", foreignKey = ForeignKey(name = "FK__info_hosts__infos")) val addresses: List, @Column(name = "legal_identities_certs") @ManyToMany(cascade = arrayOf(CascadeType.ALL)) @JoinTable(name = "node_link_nodeinfo_party", - joinColumns = arrayOf(JoinColumn(name = "node_info_id")), - inverseJoinColumns = arrayOf(JoinColumn(name = "party_name"))) + joinColumns = arrayOf(JoinColumn(name = "node_info_id", foreignKey = ForeignKey(name = "FK__link_nodeinfo_party__infos"))), + inverseJoinColumns = arrayOf(JoinColumn(name = "party_name", foreignKey = ForeignKey(name = "FK__link_ni_p__info_p_cert")))) val legalIdentitiesAndCerts: List, @Column(name = "platform_version") @@ -113,8 +113,8 @@ object NodeInfoSchemaV1 : MappedSchema( ) { constructor(partyAndCert: PartyAndCertificate, isMain: Boolean = false) : this(partyAndCert.name.toString(), - partyAndCert.party.owningKey.toStringShort(), - partyAndCert.serialize(context = SerializationDefaults.STORAGE_CONTEXT).bytes, isMain) + partyAndCert.party.owningKey.toStringShort(), + partyAndCert.serialize(context = SerializationDefaults.STORAGE_CONTEXT).bytes, isMain) fun toLegalIdentityAndCert(): PartyAndCertificate { return partyCertBinary.deserialize() diff --git a/core/src/main/kotlin/net/corda/core/schemas/CommonSchema.kt b/core/src/main/kotlin/net/corda/core/schemas/CommonSchema.kt index 22aabb959f..4086cd7d2d 100644 --- a/core/src/main/kotlin/net/corda/core/schemas/CommonSchema.kt +++ b/core/src/main/kotlin/net/corda/core/schemas/CommonSchema.kt @@ -23,12 +23,8 @@ object CommonSchemaV1 : MappedSchema(schemaFamily = CommonSchema.javaClass, vers /** [ContractState] attributes */ /** X500Name of participant parties **/ - @ElementCollection - @Column(name = "participants") - @CollectionTable(name="state_participants",joinColumns = arrayOf( - JoinColumn(name = "output_index", referencedColumnName = "output_index"), - JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) - var participants: MutableSet? = null, + @Transient + open var participants: MutableSet? = null, /** * Represents a [LinearState] [UniqueIdentifier] @@ -52,12 +48,8 @@ object CommonSchemaV1 : MappedSchema(schemaFamily = CommonSchema.javaClass, vers /** [ContractState] attributes */ /** X500Name of participant parties **/ - @ElementCollection - @Column(name = "participants") - @CollectionTable(name="state_participants",joinColumns = arrayOf( - JoinColumn(name = "output_index", referencedColumnName = "output_index"), - JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) - var participants: MutableSet? = null, + @Transient + open var participants: MutableSet? = null, /** [OwnableState] attributes */ diff --git a/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt b/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt index 923536493c..3de6f4224b 100644 --- a/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt +++ b/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt @@ -1,5 +1,6 @@ package net.corda.core.schemas +import com.google.common.base.CaseFormat import net.corda.core.contracts.ContractState import net.corda.core.contracts.StateRef import net.corda.core.serialization.CordaSerializable @@ -47,7 +48,7 @@ open class MappedSchema(schemaFamily: Class<*>, */ protected open val migrationResource: String? = null - internal fun getMigrationResource(): String = migrationResource ?: throw IllegalStateException("Migration resource not set for schema $this") + internal fun getMigrationResource(): String? = migrationResource override fun toString(): String = "${this.javaClass.simpleName}(name=$name, version=$version)" } @@ -79,4 +80,24 @@ data class PersistentStateRef( */ interface StatePersistable -fun getMigrationResource(schema: MappedSchema): String = schema.getMigrationResource() \ No newline at end of file +private const val MIGRATION_PREFIX = "migration" +private val possibleMigrationExtensions = listOf(".xml", ".sql", ".yml", ".json") +fun getMigrationResource(schema: MappedSchema): String? { + + val declaredMigration = schema.getMigrationResource() + + if (declaredMigration == null) { + // try to apply a naming convention + // SchemaName will be transformed from camel case to hyphen + // then ".changelog-master" plus one of the supported extensions will be added + val name: String = schema::class.simpleName!! + val fileName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name) + val resource = "${MIGRATION_PREFIX}/${fileName}.changelog-master" + val foundResource = possibleMigrationExtensions.map { "${resource}${it}" }.firstOrNull { + Thread.currentThread().contextClassLoader.getResource(it) != null + } + return foundResource + } else { + return "${MIGRATION_PREFIX}/${declaredMigration}.xml" + } +} \ No newline at end of file diff --git a/finance/src/main/resources/database/postgresql/scripts/create-db.sql b/finance/src/main/resources/database/postgresql/scripts/create-db.sql deleted file mode 100644 index 66240e8db1..0000000000 --- a/finance/src/main/resources/database/postgresql/scripts/create-db.sql +++ /dev/null @@ -1,32 +0,0 @@ -create table contract_cash_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - ccy_code varchar(3), - issuer_key_hash varchar(130), - issuer_ref bytea, - owner_name varchar(255), - pennies int8, - primary key (output_index, transaction_id) -); - -create index ccy_code_idx on contract_cash_states (ccy_code); -create index pennies_idx on contract_cash_states (pennies); - - -create table cp_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - ccy_code varchar(3), - face_value int8, - face_value_issuer_key_hash varchar(130), - face_value_issuer_ref bytea, - issuance_key_hash varchar(130), - issuance_ref bytea, - maturity_instant timestamp, - owner_key_hash varchar(130), - primary key (output_index, transaction_id) -); - -create index ccy_code_index on cp_states (ccy_code); -create index maturity_index on cp_states (maturity_instant); -create index face_value_index on cp_states (face_value); diff --git a/finance/src/main/resources/database/sqlserver/scripts/create-db.sql b/finance/src/main/resources/database/sqlserver/scripts/create-db.sql deleted file mode 100644 index 0d382263f4..0000000000 --- a/finance/src/main/resources/database/sqlserver/scripts/create-db.sql +++ /dev/null @@ -1,32 +0,0 @@ -create table contract_cash_states ( - output_index int not null, - transaction_id varchar(64) not null, - ccy_code varchar(3), - issuer_key_hash varchar(130), - issuer_ref varbinary(512), - owner_name varchar(255), - pennies bigint, - primary key (output_index, transaction_id) -); - -create index ccy_code_idx on contract_cash_states (ccy_code); -create index pennies_idx on contract_cash_states (pennies); - - -create table cp_states ( - output_index int not null, - transaction_id varchar(64) not null, - ccy_code varchar(3), - face_value bigint, - face_value_issuer_key_hash varchar(130), - face_value_issuer_ref varbinary(512), - issuance_key_hash varchar(130), - issuance_ref varbinary(255), - maturity_instant datetime2, - owner_key_hash varchar(130), - primary key (output_index, transaction_id) -); - -create index ccy_code_index on cp_states (ccy_code); -create index maturity_index on cp_states (maturity_instant); -create index face_value_index on cp_states (face_value); diff --git a/finance/src/main/resources/migration/cash.changelog-init.xml b/finance/src/main/resources/migration/cash.changelog-init.xml index 33cd6f68ff..e38eb7c695 100644 --- a/finance/src/main/resources/migration/cash.changelog-init.xml +++ b/finance/src/main/resources/migration/cash.changelog-init.xml @@ -1,6 +1,6 @@ - + @@ -15,15 +15,15 @@ - + - + - + diff --git a/finance/src/main/resources/migration/commercial-paper.changelog-init.xml b/finance/src/main/resources/migration/commercial-paper.changelog-init.xml index 85d1387ae1..8c43d38aae 100644 --- a/finance/src/main/resources/migration/commercial-paper.changelog-init.xml +++ b/finance/src/main/resources/migration/commercial-paper.changelog-init.xml @@ -1,6 +1,6 @@ - + @@ -18,20 +18,20 @@ - + - + - + - + diff --git a/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV2.kt b/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV2.kt index 13ccdd6420..93f5aec202 100644 --- a/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV2.kt +++ b/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV2.kt @@ -4,10 +4,7 @@ import net.corda.core.identity.AbstractParty import net.corda.core.schemas.CommonSchemaV1 import net.corda.core.schemas.MappedSchema import net.corda.core.utilities.OpaqueBytes -import javax.persistence.Column -import javax.persistence.Entity -import javax.persistence.Index -import javax.persistence.Table +import javax.persistence.* /** * Second version of a cash contract ORM schema that extends the common @@ -22,6 +19,14 @@ object SampleCashSchemaV2 : MappedSchema(schemaFamily = CashSchema.javaClass, ve @Table(name = "cash_states_v2", indexes = arrayOf(Index(name = "ccy_code_idx2", columnList = "ccy_code"))) class PersistentCashState( + + @ElementCollection + @Column(name = "participants") + @CollectionTable(name="cash_states_v2_participants", joinColumns = arrayOf( + JoinColumn(name = "output_index", referencedColumnName = "output_index"), + JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) + override var participants: MutableSet? = null, + /** product type */ @Column(name = "ccy_code", length = 3) var currency: String, diff --git a/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV3.kt b/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV3.kt index 9b0b14df29..e67aa511e9 100644 --- a/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV3.kt +++ b/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCashSchemaV3.kt @@ -23,7 +23,7 @@ object SampleCashSchemaV3 : MappedSchema(schemaFamily = CashSchema.javaClass, ve /** X500Name of participant parties **/ @ElementCollection - @CollectionTable(name="state_participants", joinColumns = arrayOf( + @CollectionTable(name="cash_state_participants", joinColumns = arrayOf( JoinColumn(name = "output_index", referencedColumnName = "output_index"), JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) var participants: MutableSet? = null, diff --git a/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCommercialPaperSchemaV2.kt b/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCommercialPaperSchemaV2.kt index dc07367af7..25cef9f9c5 100644 --- a/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCommercialPaperSchemaV2.kt +++ b/finance/src/test/kotlin/net/corda/finance/sampleschemas/SampleCommercialPaperSchemaV2.kt @@ -8,10 +8,7 @@ import net.corda.core.utilities.MAX_HASH_HEX_SIZE import net.corda.core.utilities.OpaqueBytes import org.hibernate.annotations.Type import java.time.Instant -import javax.persistence.Column -import javax.persistence.Entity -import javax.persistence.Index -import javax.persistence.Table +import javax.persistence.* /** * Second version of a cash contract ORM schema that extends the common @@ -27,6 +24,14 @@ object SampleCommercialPaperSchemaV2 : MappedSchema(schemaFamily = CommercialPap indexes = arrayOf(Index(name = "ccy_code_index2", columnList = "ccy_code"), Index(name = "maturity_index2", columnList = "maturity_instant"))) class PersistentCommercialPaperState( + + @ElementCollection + @Column(name = "participants") + @CollectionTable(name="cp_states_v2_participants", joinColumns = arrayOf( + JoinColumn(name = "output_index", referencedColumnName = "output_index"), + JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) + override var participants: MutableSet? = null, + @Column(name = "maturity_instant") var maturity: Instant, diff --git a/finance/src/test/resources/migration/sample-cash-v1.changelog-init.xml b/finance/src/test/resources/migration/sample-cash-v1.changelog-init.xml index e19446d4d9..5d49ce8857 100644 --- a/finance/src/test/resources/migration/sample-cash-v1.changelog-init.xml +++ b/finance/src/test/resources/migration/sample-cash-v1.changelog-init.xml @@ -3,7 +3,7 @@ xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -18,16 +18,16 @@ - + - + - + diff --git a/finance/src/test/resources/migration/sample-cash-v2.changelog-init.xml b/finance/src/test/resources/migration/sample-cash-v2.changelog-init.xml index 0aa167c299..80dbfd53c7 100644 --- a/finance/src/test/resources/migration/sample-cash-v2.changelog-init.xml +++ b/finance/src/test/resources/migration/sample-cash-v2.changelog-init.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -26,6 +26,22 @@ + + + + + + + + + + + + diff --git a/finance/src/test/resources/migration/sample-cash-v3.changelog-init.xml b/finance/src/test/resources/migration/sample-cash-v3.changelog-init.xml index e4b513e9ed..ef3e69f8c9 100644 --- a/finance/src/test/resources/migration/sample-cash-v3.changelog-init.xml +++ b/finance/src/test/resources/migration/sample-cash-v3.changelog-init.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -22,6 +22,16 @@ + + + + + + + + + + diff --git a/finance/src/test/resources/migration/sample-cp-v1.changelog-init.xml b/finance/src/test/resources/migration/sample-cp-v1.changelog-init.xml index 21e213b311..edaff18a51 100644 --- a/finance/src/test/resources/migration/sample-cp-v1.changelog-init.xml +++ b/finance/src/test/resources/migration/sample-cp-v1.changelog-init.xml @@ -3,7 +3,7 @@ xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -21,7 +21,7 @@ - + diff --git a/finance/src/test/resources/migration/sample-cp-v2.changelog-init.xml b/finance/src/test/resources/migration/sample-cp-v2.changelog-init.xml index 4429ca7c3e..af454da033 100644 --- a/finance/src/test/resources/migration/sample-cp-v2.changelog-init.xml +++ b/finance/src/test/resources/migration/sample-cp-v2.changelog-init.xml @@ -3,7 +3,7 @@ xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -28,5 +28,20 @@ + + + + + + + + + + + diff --git a/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/PersistenceUtils.kt b/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/PersistenceUtils.kt index 1841350fad..9d4a45dbf8 100644 --- a/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/PersistenceUtils.kt +++ b/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/PersistenceUtils.kt @@ -39,7 +39,7 @@ fun configureDatabase(dataSourceProperties: Properties, val schemas = setOf(NetworkManagementSchemaServices.SchemaV1) if (databaseConfig.runMigration) { - SchemaMigration(schemas, dataSource, databaseConfig.schema).runMigration() + SchemaMigration(schemas, dataSource, true, databaseConfig.schema).runMigration() } return CordaPersistence(dataSource, databaseConfig, schemas, config.dataSourceProperties.getProperty("url", ""), emptyList()) diff --git a/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/entity/CertificateSigningRequestEntity.kt b/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/entity/CertificateSigningRequestEntity.kt index 68f7b98750..40f44c6599 100644 --- a/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/entity/CertificateSigningRequestEntity.kt +++ b/network-management/src/main/kotlin/com/r3/corda/networkmanage/common/persistence/entity/CertificateSigningRequestEntity.kt @@ -100,7 +100,7 @@ class CertificateDataEntity( val certificatePathBytes: ByteArray, @OneToOne(fetch = FetchType.EAGER, optional = false) - @JoinColumn(name = "certificate_signing_request") + @JoinColumn(name = "certificate_signing_request", foreignKey = ForeignKey(name = "FK__cert_data__cert_sign_req")) val certificateSigningRequest: CertificateSigningRequestEntity ) { fun toCertificateData(): CertificateData { diff --git a/network-management/src/main/resources/migration/network-manager.changelog-init.xml b/network-management/src/main/resources/migration/network-manager.changelog-init.xml index 0670653904..59a5f4985e 100644 --- a/network-management/src/main/resources/migration/network-manager.changelog-init.xml +++ b/network-management/src/main/resources/migration/network-manager.changelog-init.xml @@ -1,18 +1,18 @@ - + - + - + - + - + @@ -20,7 +20,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -119,77 +119,78 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + - - + + - - + + + + + diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/CordaPersistence.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/CordaPersistence.kt index 0aca6022c9..c8cc4cfc35 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/CordaPersistence.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/CordaPersistence.kt @@ -229,3 +229,5 @@ fun parserTransactionIsolationLevel(property: String?): Int = Connection.TRANSACTION_REPEATABLE_READ } } + +fun isH2Database(jdbcUrl: String) = jdbcUrl.startsWith("jdbc:h2:") \ No newline at end of file diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/HibernateConfiguration.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/HibernateConfiguration.kt index 2857ed5372..da84b91749 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/HibernateConfiguration.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/HibernateConfiguration.kt @@ -47,7 +47,7 @@ class HibernateConfiguration( val metadataSources = MetadataSources(serviceRegistry) val config = Configuration(metadataSources).setProperty("hibernate.connection.provider_class", NodeDatabaseConnectionProvider::class.java.name) - .setProperty("hibernate.hbm2ddl.auto", "validate") + .setProperty("hibernate.hbm2ddl.auto", if (isH2Database(jdbcUrl)) "update" else "validate") .setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString()) databaseConfig.schema?.apply { @@ -86,8 +86,7 @@ class HibernateConfiguration( try { mbeanServer.registerMBean(statisticsMBean, statsName) - } - catch (e: Exception) { + } catch (e: Exception) { logger.warn(e.message) } } diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/SchemaMigration.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/SchemaMigration.kt index 9bee1eb403..3675c9b0bd 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/SchemaMigration.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/SchemaMigration.kt @@ -14,9 +14,7 @@ import net.corda.core.utilities.contextLogger import java.io.* import javax.sql.DataSource -private const val MIGRATION_PREFIX = "migration" - -class SchemaMigration(val schemas: Set, val dataSource: DataSource, private val schemaName: String? = null) { +class SchemaMigration(val schemas: Set, val dataSource: DataSource, val failOnMigrationMissing: Boolean, private val schemaName: String? = null) { companion object { private val logger = contextLogger() @@ -33,10 +31,17 @@ class SchemaMigration(val schemas: Set, val dataSource: DataSource dataSource.connection.use { connection -> - //collect all changelog file referenced in the included schemas + // collect all changelog file referenced in the included schemas + // for backward compatibility reasons, when failOnMigrationMissing=false, we don't manage CorDapps via Liquibase but use the hibernate hbm2ddl=update val changelogList = schemas.map { mappedSchema -> - getMigrationResource(mappedSchema).let { - "${MIGRATION_PREFIX}/${it}.xml" + val resource = getMigrationResource(mappedSchema) + when { + resource != null -> resource + failOnMigrationMissing -> throw IllegalStateException("No migration defined for schema: ${mappedSchema.name} v${mappedSchema.version}") + else -> { + logger.warn("No migration defined for schema: ${mappedSchema.name} v${mappedSchema.version}") + null + } } } @@ -46,7 +51,7 @@ class SchemaMigration(val schemas: Set, val dataSource: DataSource if (path == dynamicInclude) { //create a map in liquibase format including all migration files - val includeAllFiles = mapOf("databaseChangeLog" to changelogList.map { file -> mapOf("include" to mapOf("file" to file)) }) + val includeAllFiles = mapOf("databaseChangeLog" to changelogList.filter { it != null }.map { file -> mapOf("include" to mapOf("file" to file)) }) // transform it to json val includeAllFilesJson = ObjectMapper().writeValueAsBytes(includeAllFiles) diff --git a/node/src/integration-test/resources/migration/message-schema.changelog-init.xml b/node/src/integration-test/resources/migration/message-schema.changelog-init.xml index d108e91729..3bc5bfb37e 100644 --- a/node/src/integration-test/resources/migration/message-schema.changelog-init.xml +++ b/node/src/integration-test/resources/migration/message-schema.changelog-init.xml @@ -3,7 +3,7 @@ xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + diff --git a/node/src/main/kotlin/net/corda/node/ArgsParser.kt b/node/src/main/kotlin/net/corda/node/ArgsParser.kt index 7bd7850d5d..50e3049025 100644 --- a/node/src/main/kotlin/net/corda/node/ArgsParser.kt +++ b/node/src/main/kotlin/net/corda/node/ArgsParser.kt @@ -42,7 +42,7 @@ class ArgsParser { private val justGenerateNodeInfoArg = optionParser.accepts("just-generate-node-info", "Perform the node start-up task necessary to generate its nodeInfo, save it to disk, then quit") private val justGenerateDatabaseMigrationArg = optionParser - .accepts("just-generate-database-migration", "Generate the database migration in the specified output file, and then quit.") + .accepts("just-generate-db-migration", "Generate the database migration in the specified output file, and then quit.") .withOptionalArg() private val bootstrapRaftClusterArg = optionParser.accepts("bootstrap-raft-cluster", "Bootstraps Raft cluster. The node forms a single node cluster (ignoring otherwise configured peer addresses), acting as a seed for other nodes to join the cluster.") private val helpArg = optionParser.accepts("help").forHelp() diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index 4ab8030d09..51aeee85d7 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -68,10 +68,7 @@ import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.crypto.loadKeyStore import net.corda.nodeapi.internal.network.NETWORK_PARAMS_FILE_NAME import net.corda.nodeapi.internal.network.NetworkParameters -import net.corda.nodeapi.internal.persistence.CordaPersistence -import net.corda.nodeapi.internal.persistence.DatabaseConfig -import net.corda.nodeapi.internal.persistence.HibernateConfiguration -import net.corda.nodeapi.internal.persistence.SchemaMigration +import net.corda.nodeapi.internal.persistence.* import org.apache.activemq.artemis.utils.ReusableLatch import org.hibernate.type.descriptor.java.JavaTypeDescriptorRegistry import org.slf4j.Logger @@ -206,13 +203,15 @@ abstract class AbstractNode(val configuration: NodeConfiguration, fun generateDatabaseSchema(outputFile: String) { HikariDataSource(HikariConfig(configuration.dataSourceProperties)).use { dataSource -> - SchemaMigration(cordappLoader.cordappSchemas, dataSource, configuration.database.schema).generateMigrationScript(File(outputFile)) + val jdbcUrl = configuration.dataSourceProperties.getProperty("url", "") + SchemaMigration(cordappLoader.cordappSchemas, dataSource, !isH2Database(jdbcUrl), configuration.database.schema).generateMigrationScript(File(outputFile)) } } fun runDbMigration() { HikariDataSource(HikariConfig(configuration.dataSourceProperties)).use { dataSource -> - SchemaMigration(cordappLoader.cordappSchemas, dataSource, configuration.database.schema).runMigration() + val jdbcUrl = configuration.dataSourceProperties.getProperty("url", "") + SchemaMigration(cordappLoader.cordappSchemas, dataSource, !isH2Database(jdbcUrl), configuration.database.schema).runMigration() } } @@ -557,7 +556,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, * Builds node internal, advertised, and plugin services. * Returns a list of tokenizable services to be added to the serialisation context. */ - private fun makeServices(keyPairs: Set, schemaService: SchemaService, transactionStorage: WritableTransactionStorage, database: CordaPersistence, info: NodeInfo, identityService: IdentityServiceInternal, networkMapCache: NetworkMapCacheInternal): MutableList { + private fun makeServices(keyPairs: Set, schemaService: SchemaService, transactionStorage: WritableTransactionStorage, database: CordaPersistence, info: NodeInfo, identityService: IdentityServiceInternal, networkMapCache: NetworkMapCacheInternal): MutableList { checkpointStorage = DBCheckpointStorage() val metrics = MetricRegistry() attachments = NodeAttachmentService(metrics) @@ -885,9 +884,11 @@ fun configureDatabase(dataSourceProperties: Properties, val attributeConverters = listOf(AbstractPartyToX500NameAsStringConverter(identityService)) - if(databaseConfig.runMigration){ - SchemaMigration(schemaService.schemaOptions.keys, dataSource, databaseConfig.schema).runMigration() + val jdbcUrl = config.dataSourceProperties.getProperty("url", "") + + if (databaseConfig.runMigration) { + SchemaMigration(schemaService.schemaOptions.keys, dataSource, !isH2Database(jdbcUrl), databaseConfig.schema).runMigration() } - return CordaPersistence(dataSource, databaseConfig, schemaService.schemaOptions.keys, config.dataSourceProperties.getProperty("url", ""), attributeConverters) + return CordaPersistence(dataSource, databaseConfig, schemaService.schemaOptions.keys, jdbcUrl, attributeConverters) } diff --git a/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt b/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt index 2626c01a9a..6205ecf31a 100644 --- a/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt +++ b/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt @@ -80,7 +80,8 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio @CollectionTable(name = "vault_linear_states_parts", joinColumns = arrayOf( JoinColumn(name = "output_index", referencedColumnName = "output_index"), - JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) + JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id")), + foreignKey = ForeignKey(name = "FK__lin_stat_parts__lin_stat")) @Column(name = "participants") var participants: MutableSet? = null, // Reason for not using Set is described here: @@ -112,7 +113,8 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio @CollectionTable(name = "vault_fungible_states_parts", joinColumns = arrayOf( JoinColumn(name = "output_index", referencedColumnName = "output_index"), - JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) + JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id")), + foreignKey = ForeignKey(name = "FK__fung_st_parts__fung_st")) @Column(name = "participants") var participants: MutableSet? = null, diff --git a/node/src/main/resources/database/postgresql/scripts/create-db.sql b/node/src/main/resources/database/postgresql/scripts/create-db.sql deleted file mode 100644 index 7982f1905e..0000000000 --- a/node/src/main/resources/database/postgresql/scripts/create-db.sql +++ /dev/null @@ -1,238 +0,0 @@ - -create table node_link_nodeinfo_party ( - node_info_id int4 not null, - party_name varchar(255) not null -); - - -create table node_attachments ( - att_id varchar(255) not null, - content oid, - filename varchar(255), - insertion_date timestamp not null, - uploader varchar(255), - primary key (att_id) -); - - -create table node_bft_committed_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - consuming_input_index int4, - consuming_transaction_id varchar(255), - requesting_party_name varchar(255), - requesting_party_key bytea, - primary key (output_index, transaction_id) -); - - -create table node_checkpoints ( - checkpoint_id varchar(64) not null, - checkpoint_value oid, - primary key (checkpoint_id) -); - - -create table node_contract_upgrades ( - state_ref varchar(96) not null, - contract_class_name varchar(255), - primary key (state_ref) -); - - -create table node_identities ( - pk_hash varchar(130) not null, - identity_value oid, - primary key (pk_hash) -); - - -create table node_info_hosts ( - host varchar(255) not null, - port int4 not null, - node_info_id int4, - primary key (host, port) -); - - -create table node_info_party_cert ( - party_name varchar(255) not null, - isMain boolean not null, - owning_key_hash varchar(130), - party_cert_binary oid, - primary key (party_name) -); - - -create table node_infos ( - node_info_id int4 not null, - node_info_hash varchar(64), - platform_version int4, - serial int8, - primary key (node_info_id) -); - - -create table node_message_ids ( - message_id varchar(36) not null, - insertion_time timestamp, - primary key (message_id) -); - - -create table node_message_retry ( - message_id int8 not null, - message oid, - recipients oid, - primary key (message_id) -); - - -create table node_named_identities ( - name varchar(128) not null, - pk_hash varchar(130), - primary key (name) -); - - -create table node_notary_commit_log ( - output_index int4 not null, - transaction_id varchar(64) not null, - consuming_input_index int4, - consuming_transaction_id varchar(255), - requesting_party_name varchar(255), - requesting_party_key bytea, - primary key (output_index, transaction_id) -); - - -create table node_our_key_pairs ( - public_key_hash varchar(130) not null, - private_key oid, - public_key oid, - primary key (public_key_hash) -); - - -create table node_raft_committed_states ( - id varchar(255) not null, - state_index int8, - state_value oid, - primary key (id) -); - - -create table node_scheduled_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - scheduled_at timestamp not null, - primary key (output_index, transaction_id) -); - - -create table node_transaction_mappings ( - tx_id varchar(64) not null, - state_machine_run_id varchar(36), - primary key (tx_id) -); - - -create table node_transactions ( - tx_id varchar(64) not null, - transaction_value oid, - primary key (tx_id) -); - - -create table vault_fungible_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - issuer_name varchar(255), - issuer_ref bytea, - owner_name varchar(255), - quantity int8, - primary key (output_index, transaction_id) -); - - -create table vault_fungible_states_parts ( - output_index int4 not null, - transaction_id varchar(64) not null, - participants varchar(255) -); - - -create table vault_linear_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - external_id varchar(255), - uuid bytea not null, - primary key (output_index, transaction_id) -); - - -create table vault_linear_states_parts ( - output_index int4 not null, - transaction_id varchar(64) not null, - participants varchar(255) -); - - -create table vault_states ( - output_index int4 not null, - transaction_id varchar(64) not null, - consumed_timestamp timestamp, - contract_state_class_name varchar(255), - lock_id varchar(255), - lock_timestamp timestamp, - notary_name varchar(255), - recorded_timestamp timestamp, - state_status int4, - primary key (output_index, transaction_id) -); - - -create table vault_transaction_notes ( - seq_no int4 not null, - note varchar(255), - transaction_id varchar(64), - primary key (seq_no) -); - -create index att_id_idx on node_attachments (att_id); -create index external_id_index on vault_linear_states (external_id); -create index uuid_index on vault_linear_states (uuid); -create index state_status_idx on vault_states (state_status); -create index lock_id_idx on vault_states (lock_id, state_status); -create index transaction_id_index on vault_transaction_notes (transaction_id); -create sequence hibernate_sequence start 1 increment 1; - - -alter table node_link_nodeinfo_party - add constraint FK1ua3h6nwwfji0mn23c5d1xx8e - foreign key (party_name) - references node_info_party_cert; - - -alter table node_link_nodeinfo_party - add constraint FK544l9wsec35ph7hxrtwfd2lws - foreign key (node_info_id) - references node_infos; - - -alter table node_info_hosts - add constraint FK5ie46htdrkftmwe6rpwrnp0mp - foreign key (node_info_id) - references node_infos; - - -alter table vault_fungible_states_parts - add constraint FKchmfeq1ldqnoq9idv9ogxauqm - foreign key (output_index, transaction_id) - references vault_fungible_states; - - -alter table vault_linear_states_parts - add constraint FKhafsv733d0bo9j1tg352koq3y - foreign key (output_index, transaction_id) - references vault_linear_states; diff --git a/node/src/main/resources/database/sqlserver/scripts/create-db.sql b/node/src/main/resources/database/sqlserver/scripts/create-db.sql deleted file mode 100644 index 508c338681..0000000000 --- a/node/src/main/resources/database/sqlserver/scripts/create-db.sql +++ /dev/null @@ -1,236 +0,0 @@ -create table node_link_nodeinfo_party ( - node_info_id int not null, - party_name varchar(255) not null -); - - -create table node_attachments ( - att_id varchar(255) not null, - content varbinary(MAX), - filename varchar(255), - insertion_date datetime2 not null, - uploader varchar(255), - primary key (att_id) -); - - -create table node_bft_committed_states ( - output_index int not null, - transaction_id varchar(64) not null, - consuming_input_index int, - consuming_transaction_id varchar(255), - requesting_party_name varchar(255), - requesting_party_key varbinary(255), - primary key (output_index, transaction_id) -); - - -create table node_checkpoints ( - checkpoint_id varchar(64) not null, - checkpoint_value varbinary(MAX), - primary key (checkpoint_id) -); - - -create table node_contract_upgrades ( - state_ref varchar(96) not null, - contract_class_name varchar(255), - primary key (state_ref) -); - - -create table node_identities ( - pk_hash varchar(130) not null, - identity_value varbinary(MAX), - primary key (pk_hash) -); - - -create table node_info_hosts ( - host varchar(255) not null, - port int not null, - node_info_id int, - primary key (host, port) -); - - -create table node_info_party_cert ( - party_name varchar(255) not null, - isMain bit not null, - owning_key_hash varchar(130), - party_cert_binary varbinary(MAX), - primary key (party_name) -); - - -create table node_infos ( - node_info_id int not null, - node_info_hash varchar(64), - platform_version int, - serial bigint, - primary key (node_info_id) -); - - -create table node_message_ids ( - message_id varchar(36) not null, - insertion_time datetime2, - primary key (message_id) -); - - -create table node_message_retry ( - message_id bigint not null, - message varbinary(MAX), - recipients varbinary(MAX), - primary key (message_id) -); - - -create table node_named_identities ( - name varchar(128) not null, - pk_hash varchar(130), - primary key (name) -); - - -create table node_notary_commit_log ( - output_index int not null, - transaction_id varchar(64) not null, - consuming_input_index int, - consuming_transaction_id varchar(255), - requesting_party_name varchar(255), - requesting_party_key varbinary(255), - primary key (output_index, transaction_id) -); - - -create table node_our_key_pairs ( - public_key_hash varchar(130) not null, - private_key varbinary(MAX), - public_key varbinary(MAX), - primary key (public_key_hash) -); - - -create table node_raft_committed_states ( - id varchar(255) not null, - state_index bigint, - state_value varbinary(MAX), - primary key (id) -); - - -create table node_scheduled_states ( - output_index int not null, - transaction_id varchar(64) not null, - scheduled_at datetime2 not null, - primary key (output_index, transaction_id) -); - - -create table node_transaction_mappings ( - tx_id varchar(64) not null, - state_machine_run_id varchar(36), - primary key (tx_id) -); - - -create table node_transactions ( - tx_id varchar(64) not null, - transaction_value varbinary(MAX), - primary key (tx_id) -); - - -create table vault_fungible_states ( - output_index int not null, - transaction_id varchar(64) not null, - issuer_name varchar(255), - issuer_ref varbinary(512), - owner_name varchar(255), - quantity bigint, - primary key (output_index, transaction_id) -); - - -create table vault_fungible_states_parts ( - output_index int not null, - transaction_id varchar(64) not null, - participants varchar(255) -); - - -create table vault_linear_states ( - output_index int not null, - transaction_id varchar(64) not null, - external_id varchar(255), - uuid binary(255) not null, - primary key (output_index, transaction_id) -); - - -create table vault_linear_states_parts ( - output_index int not null, - transaction_id varchar(64) not null, - participants varchar(255) -); - - -create table vault_states ( - output_index int not null, - transaction_id varchar(64) not null, - consumed_timestamp datetime2, - contract_state_class_name varchar(255), - lock_id varchar(255), - lock_timestamp datetime2, - notary_name varchar(255), - recorded_timestamp datetime2, - state_status int, - primary key (output_index, transaction_id) -); - - -create table vault_transaction_notes ( - seq_no int not null, - note varchar(255), - transaction_id varchar(64), - primary key (seq_no) -); -create index att_id_idx on node_attachments (att_id); -create index external_id_index on vault_linear_states (external_id); -create index uuid_index on vault_linear_states (uuid); -create index state_status_idx on vault_states (state_status); -create index lock_id_idx on vault_states (lock_id, state_status); -create index transaction_id_index on vault_transaction_notes (transaction_id); -create sequence hibernate_sequence start with 1 increment by 1; - - -alter table node_link_nodeinfo_party - add constraint FK1ua3h6nwwfji0mn23c5d1xx8e - foreign key (party_name) - references node_info_party_cert; - - -alter table node_link_nodeinfo_party - add constraint FK544l9wsec35ph7hxrtwfd2lws - foreign key (node_info_id) - references node_infos; - - -alter table node_info_hosts - add constraint FK5ie46htdrkftmwe6rpwrnp0mp - foreign key (node_info_id) - references node_infos; - - -alter table vault_fungible_states_parts - add constraint FKchmfeq1ldqnoq9idv9ogxauqm - foreign key (output_index, transaction_id) - references vault_fungible_states; - - -alter table vault_linear_states_parts - add constraint FKhafsv733d0bo9j1tg352koq3y - foreign key (output_index, transaction_id) - references vault_linear_states; diff --git a/node/src/main/resources/migration/common.changelog-init.xml b/node/src/main/resources/migration/common.changelog-init.xml index e4091448e2..e309a4e33a 100644 --- a/node/src/main/resources/migration/common.changelog-init.xml +++ b/node/src/main/resources/migration/common.changelog-init.xml @@ -4,29 +4,17 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + - + - + - + - - - - - - - - - - - - diff --git a/node/src/main/resources/migration/node-info.changelog-init.xml b/node/src/main/resources/migration/node-info.changelog-init.xml index 1cd6ccfa2e..0396ad675c 100644 --- a/node/src/main/resources/migration/node-info.changelog-init.xml +++ b/node/src/main/resources/migration/node-info.changelog-init.xml @@ -3,7 +3,7 @@ xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -13,7 +13,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -46,27 +46,25 @@ - + - + - + - + - + diff --git a/node/src/main/resources/migration/node-services.changelog-init.xml b/node/src/main/resources/migration/node-services.changelog-init.xml index a2be6c82ac..8401199abc 100644 --- a/node/src/main/resources/migration/node-services.changelog-init.xml +++ b/node/src/main/resources/migration/node-services.changelog-init.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -142,7 +142,7 @@ - + @@ -153,61 +153,65 @@ - + - + - + - + - + - + - + - + - + - + - - + - + - + - + - + + + + + + diff --git a/node/src/main/resources/migration/vault-schema.changelog-init.xml b/node/src/main/resources/migration/vault-schema.changelog-init.xml index e6a3dfb2bd..388e5b030d 100644 --- a/node/src/main/resources/migration/vault-schema.changelog-init.xml +++ b/node/src/main/resources/migration/vault-schema.changelog-init.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -18,7 +18,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -80,60 +80,58 @@ - + - + - + - + - + - + - + - + - + - + - + diff --git a/node/src/test/resources/migration/test.changelog-init.xml b/node/src/test/resources/migration/test.changelog-init.xml index 582178516d..94356c8ac1 100644 --- a/node/src/test/resources/migration/test.changelog-init.xml +++ b/node/src/test/resources/migration/test.changelog-init.xml @@ -1,7 +1,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/perftestcordapp/src/main/resources/migration/cash-pt.changelog-init.xml b/perftestcordapp/src/main/resources/migration/cash-pt.changelog-init.xml index 7eaa21fb47..b3a1ff183b 100644 --- a/perftestcordapp/src/main/resources/migration/cash-pt.changelog-init.xml +++ b/perftestcordapp/src/main/resources/migration/cash-pt.changelog-init.xml @@ -1,6 +1,6 @@ - + @@ -15,15 +15,15 @@ - + - + - + diff --git a/perftestcordapp/src/main/resources/migration/commercial-paper-pt.changelog-init.xml b/perftestcordapp/src/main/resources/migration/commercial-paper-pt.changelog-init.xml index 5d12dc794d..c20227cddf 100644 --- a/perftestcordapp/src/main/resources/migration/commercial-paper-pt.changelog-init.xml +++ b/perftestcordapp/src/main/resources/migration/commercial-paper-pt.changelog-init.xml @@ -1,6 +1,6 @@ - + @@ -18,20 +18,20 @@ - + - + - + - + diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealContract.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealContract.kt index 453dac658c..1cd75a83b0 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealContract.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealContract.kt @@ -31,7 +31,7 @@ class DummyDealContract : Contract { override fun generateMappedObject(schema: MappedSchema): PersistentState { return when (schema) { is DummyDealStateSchemaV1 -> DummyDealStateSchemaV1.PersistentDummyDealState( - _participants = participants.toSet(), + participants = participants.toMutableSet(), uid = linearId ) else -> throw IllegalArgumentException("Unrecognised schema $schema") diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealStateSchemaV1.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealStateSchemaV1.kt index 46fcb35539..fa23127f06 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealStateSchemaV1.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyDealStateSchemaV1.kt @@ -4,9 +4,7 @@ import net.corda.core.contracts.UniqueIdentifier import net.corda.core.identity.AbstractParty import net.corda.core.schemas.CommonSchemaV1 import net.corda.core.schemas.MappedSchema -import javax.persistence.Entity -import javax.persistence.Table -import javax.persistence.Transient +import javax.persistence.* /** * An object used to fully qualify the [DummyDealStateSchema] family name (i.e. independent of version). @@ -24,12 +22,16 @@ object DummyDealStateSchemaV1 : MappedSchema(schemaFamily = DummyDealStateSchema @Entity @Table(name = "dummy_deal_states") class PersistentDummyDealState( - /** parent attributes */ - @Transient - val _participants: Set, + + @ElementCollection + @Column(name = "participants") + @CollectionTable(name = "dummy_deal_states_participants", joinColumns = arrayOf( + JoinColumn(name = "output_index", referencedColumnName = "output_index"), + JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) + override var participants: MutableSet? = null, @Transient val uid: UniqueIdentifier - ) : CommonSchemaV1.LinearState(uid, _participants) + ) : CommonSchemaV1.LinearState(uuid = uid.id, externalId = uid.externalId, participants = participants) } diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearContract.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearContract.kt index 0a2a962084..359e602180 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearContract.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearContract.kt @@ -49,7 +49,7 @@ class DummyLinearContract : Contract { linearBoolean = linearBoolean ) is DummyLinearStateSchemaV2 -> DummyLinearStateSchemaV2.PersistentDummyLinearState( - _participants = participants.toSet(), + participants = participants.toMutableSet(), uid = linearId, linearString = linearString, linearNumber = linearNumber, diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV1.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV1.kt index 666a397d20..f0770d7317 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV1.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV1.kt @@ -31,7 +31,8 @@ object DummyLinearStateSchemaV1 : MappedSchema(schemaFamily = DummyLinearStateSc /** X500Name of participant parties **/ @ElementCollection - @CollectionTable(name="state_participants",joinColumns = arrayOf( + @Column(name = "participants") + @CollectionTable(name = "dummy_linear_state_participants", joinColumns = arrayOf( JoinColumn(name = "output_index", referencedColumnName = "output_index"), JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) var participants: MutableSet, diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV2.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV2.kt index 99d37133be..e4f7c6b12a 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV2.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/vault/DummyLinearStateSchemaV2.kt @@ -4,9 +4,7 @@ import net.corda.core.contracts.UniqueIdentifier import net.corda.core.identity.AbstractParty import net.corda.core.schemas.CommonSchemaV1 import net.corda.core.schemas.MappedSchema -import javax.persistence.Column -import javax.persistence.Entity -import javax.persistence.Table +import javax.persistence.* /** * Second version of a cash contract ORM schema that extends the common @@ -20,6 +18,14 @@ object DummyLinearStateSchemaV2 : MappedSchema(schemaFamily = DummyLinearStateSc @Entity @Table(name = "dummy_linear_states_v2") class PersistentDummyLinearState( + + @ElementCollection + @Column(name = "participants") + @CollectionTable(name = "dummy_linear_states_v2_participants", joinColumns = arrayOf( + JoinColumn(name = "output_index", referencedColumnName = "output_index"), + JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id"))) + override var participants: MutableSet? = null, + @Column(name = "linear_string") var linearString: String, @Column(name = "linear_number") var linearNumber: Long, @@ -28,11 +34,7 @@ object DummyLinearStateSchemaV2 : MappedSchema(schemaFamily = DummyLinearStateSc @Column(name = "linear_boolean") var linearBoolean: Boolean, - /** parent attributes */ - @Transient - val _participants: Set, - @Transient val uid: UniqueIdentifier - ) : CommonSchemaV1.LinearState(uid, _participants) + ) : CommonSchemaV1.LinearState(uuid = uid.id, externalId = uid.externalId, participants = participants) } diff --git a/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-global-cleanup.sql b/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-global-cleanup.sql index c3fb09ac33..dcbe40676f 100644 --- a/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-global-cleanup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-global-cleanup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-setup.sql b/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-setup.sql index 74fe7c442a..88b4b33df3 100644 --- a/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-setup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/azure-sql/db-setup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-cleanup.sql b/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-cleanup.sql index 7388081af4..7051c5e8c7 100644 --- a/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-cleanup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-cleanup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-setup.sql b/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-setup.sql index 29463d973f..9a8eb485c1 100644 --- a/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-setup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-global-setup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-setup.sql b/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-setup.sql index 74fe7c442a..88b4b33df3 100644 --- a/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-setup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/sql-server-no-default-schema/db-setup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-cleanup.sql b/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-cleanup.sql index 6245118de0..417102c39c 100644 --- a/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-cleanup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-cleanup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-setup.sql b/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-setup.sql index ac53ec2a1a..64527cda93 100644 --- a/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-setup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/sql-server/db-global-setup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/database-scripts/sql-server/db-setup.sql b/testing/test-utils/src/main/resources/database-scripts/sql-server/db-setup.sql index 69e8b477bd..91d06fe247 100644 --- a/testing/test-utils/src/main/resources/database-scripts/sql-server/db-setup.sql +++ b/testing/test-utils/src/main/resources/database-scripts/sql-server/db-setup.sql @@ -1,3 +1,9 @@ +DROP TABLE IF EXISTS ${schema}.cash_state_participants; +DROP TABLE IF EXISTS ${schema}.cash_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.cp_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_state_participants; +DROP TABLE IF EXISTS ${schema}.dummy_linear_states_v2_participants; +DROP TABLE IF EXISTS ${schema}.dummy_deal_states_participants; DROP TABLE IF EXISTS ${schema}.node_attachments; DROP TABLE IF EXISTS ${schema}.node_checkpoints; DROP TABLE IF EXISTS ${schema}.node_transactions; diff --git a/testing/test-utils/src/main/resources/migration/dummy-deal.changelog-init.xml b/testing/test-utils/src/main/resources/migration/dummy-deal.changelog-init.xml index 5104c3c34f..3a2ccd1b66 100644 --- a/testing/test-utils/src/main/resources/migration/dummy-deal.changelog-init.xml +++ b/testing/test-utils/src/main/resources/migration/dummy-deal.changelog-init.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd"> - + @@ -18,7 +18,25 @@ + + + + + + + + + + + + + + - diff --git a/testing/test-utils/src/main/resources/migration/dummy-linear-v1.changelog-init.xml b/testing/test-utils/src/main/resources/migration/dummy-linear-v1.changelog-init.xml index 8d1e09978c..27e2d321d8 100644 --- a/testing/test-utils/src/main/resources/migration/dummy-linear-v1.changelog-init.xml +++ b/testing/test-utils/src/main/resources/migration/dummy-linear-v1.changelog-init.xml @@ -2,7 +2,7 @@ - + @@ -23,6 +23,22 @@ + + + + + + + + + + + + diff --git a/testing/test-utils/src/main/resources/migration/dummy-linear-v2.changelog-init.xml b/testing/test-utils/src/main/resources/migration/dummy-linear-v2.changelog-init.xml index 4c9263dc06..125b485ac5 100644 --- a/testing/test-utils/src/main/resources/migration/dummy-linear-v2.changelog-init.xml +++ b/testing/test-utils/src/main/resources/migration/dummy-linear-v2.changelog-init.xml @@ -3,7 +3,7 @@ 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"> - + @@ -24,5 +24,21 @@ + + + + + + + + + + + +