mirror of
https://github.com/corda/corda.git
synced 2025-01-18 02:39:51 +00:00
[CORDA-2547] Migrate table of SimpleNotaryService (#4722)
* CORDA-2547: WIP Migrate old notary schema correctly. Modify liquibase scripts to rename the old committed state table instead of creating a new one. * Rename liquibase change sets * Change 3.3 baseline before Liquibase. * Aligin with ENT, orginal node-notary.changelog-v1.xml moved to node-notary.changelog-v2.xml and it's compatible with ENT (which already has changes from v2). * Aligin with ENT, orginal node-notary.changelog-v1.xml moved to node-notary.changelog-v2.xml and it's compatible with ENT (which already has changes from v2) - adding v2 to master file. * Ensure setting up Liquibase on pre-existing pre-Liquibase database
This commit is contained in:
parent
f729453fee
commit
cdac97120a
@ -169,6 +169,10 @@ class SchemaMigration(
|
||||
if (schemas.any { schema -> schema.migrationResource == "notary-raft.changelog-master" })
|
||||
preV4Baseline.addAll(listOf("migration/notary-raft.changelog-init.xml",
|
||||
"migration/notary-raft.changelog-v1.xml"))
|
||||
|
||||
if (schemas.any { schema -> schema.migrationResource == "notary-bft-smart.changelog-master" })
|
||||
preV4Baseline.addAll(listOf("migration/notary-bft-smart.changelog-init.xml",
|
||||
"migration/notary-bft-smart.changelog-v1.xml"))
|
||||
}
|
||||
if (isFinanceAppWithLiquibaseNotMigrated) {
|
||||
preV4Baseline.addAll(listOf("migration/cash.changelog-init.xml",
|
||||
|
@ -1,8 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
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">
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
|
||||
<include file="migration/node-core.changelog-init.xml"/>
|
||||
<include file="migration/node-core.changelog-v3.xml"/>
|
||||
|
@ -5,8 +5,8 @@
|
||||
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">
|
||||
|
||||
<include file="migration/node-notary.changelog-init.xml"/>
|
||||
|
||||
<include file="migration/node-notary.changelog-v1.xml"/>
|
||||
<include file="migration/node-notary.changelog-v2.xml"/>
|
||||
<include file="migration/node-notary.changelog-pkey.xml"/>
|
||||
<include file="migration/node-notary.changelog-committed-transactions-table.xml" />
|
||||
|
||||
|
@ -0,0 +1,37 @@
|
||||
<?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="rename-table-notary-commit-log">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<tableExists tableName="node_notary_commit_log"/>
|
||||
</preConditions>
|
||||
<renameTable oldTableName="node_notary_commit_log" newTableName="node_notary_committed_states" />
|
||||
</changeSet>
|
||||
<changeSet author="R3.Corda" id="create-notary-request-log-table">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not>
|
||||
<tableExists tableName="node_notary_request_log"/>
|
||||
</not>
|
||||
</preConditions>
|
||||
<createTable tableName="node_notary_request_log">
|
||||
<column name="id" type="INT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="consuming_transaction_id" type="NVARCHAR(64)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="requesting_party_name" type="NVARCHAR(255)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="request_timestamp" type="TIMESTAMP">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="request_signature" type="BLOB">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
<addPrimaryKey columnNames="id" constraintName="node_notary_request_log_pkey"
|
||||
tableName="node_notary_request_log"/>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
@ -1,8 +1,7 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
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">
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||
|
||||
<include file="migration/vault-schema.changelog-init.xml"/>
|
||||
<include file="migration/vault-schema.changelog-v3.xml"/>
|
||||
|
Loading…
Reference in New Issue
Block a user