Added migrationResource for Notary schemas, and split out original liquibase node-services changelogs into node-core and node-notary

This commit is contained in:
josecoll 2018-01-18 14:20:12 +00:00
parent a099f30e61
commit a148835787
5 changed files with 79 additions and 51 deletions

View File

@ -52,7 +52,19 @@ class NodeSchemaService(extraSchemas: Set<MappedSchema> = emptySet()) : SchemaSe
ContractUpgradeServiceImpl.DBContractUpgrade::class.java,
RunOnceService.MutualExclusion::class.java
)){
override val migrationResource = "node-services.changelog-master"
override val migrationResource = "node-core.changelog-master"
}
// Entities used by a Notary
object NodeNotary
object NodeNotaryV1 : MappedSchema(schemaFamily = NodeNotary.javaClass, version = 1,
mappedTypes = listOf(PersistentUniquenessProvider.PersistentUniqueness::class.java,
PersistentUniquenessProvider.PersistentNotaryCommit::class.java,
RaftUniquenessProvider.RaftState::class.java,
BFTNonValidatingNotaryService.PersistedCommittedState::class.java
)){
override val migrationResource = "node-notary.changelog-master"
}
// Required schemas are those used by internal Corda services

View File

@ -17,20 +17,6 @@
<column name="uploader" type="NVARCHAR(255)"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-6">
<createTable tableName="node_bft_committed_states">
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consuming_input_index" type="INT"/>
<column name="consuming_transaction_id" type="NVARCHAR(255)"/>
<column name="requesting_party_name" type="NVARCHAR(255)"/>
<column name="requesting_party_key" type="varbinary(255)"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-7">
<createTable tableName="node_checkpoints">
<column name="checkpoint_id" type="NVARCHAR(64)">
@ -81,20 +67,6 @@
<column name="pk_hash" type="NVARCHAR(130)"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-16">
<createTable tableName="node_notary_commit_log">
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consuming_input_index" type="INT"/>
<column name="consuming_transaction_id" type="NVARCHAR(255)"/>
<column name="requesting_party_name" type="NVARCHAR(255)"/>
<column name="requesting_party_key" type="varbinary(255)"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-17">
<createTable tableName="node_our_key_pairs">
<column name="public_key_hash" type="NVARCHAR(130)">
@ -104,15 +76,6 @@
<column name="public_key" type="blob"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-18">
<createTable tableName="node_raft_committed_states">
<column name="id" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="state_index" type="BIGINT"/>
<column name="state_value" type="blob"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-19">
<createTable tableName="node_scheduled_states">
<column name="output_index" type="INT">
@ -156,10 +119,6 @@
<changeSet author="R3.Corda" id="1511451595465-30">
<addPrimaryKey columnNames="att_id" constraintName="node_attachments_pkey" tableName="node_attachments"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-31">
<addPrimaryKey columnNames="output_index, transaction_id" constraintName="node_bft_committed_states_pkey"
tableName="node_bft_committed_states"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-32">
<addPrimaryKey columnNames="checkpoint_id" constraintName="node_checkpoints_pkey" tableName="node_checkpoints"/>
</changeSet>
@ -181,18 +140,10 @@
<addPrimaryKey columnNames="name" constraintName="node_named_identities_pkey"
tableName="node_named_identities"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-41">
<addPrimaryKey columnNames="output_index, transaction_id" constraintName="node_notary_commit_log_pkey"
tableName="node_notary_commit_log"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-42">
<addPrimaryKey columnNames="public_key_hash" constraintName="node_our_key_pairs_pkey"
tableName="node_our_key_pairs"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-43">
<addPrimaryKey columnNames="id" constraintName="node_raft_comm_states_pkey"
tableName="node_raft_committed_states"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-44">
<addPrimaryKey columnNames="output_index, transaction_id" constraintName="node_scheduled_states_pkey"
tableName="node_scheduled_states"/>

View File

@ -4,6 +4,6 @@
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">
<include file="migration/node-services.changelog-init.xml"/>
<include file="migration/node-core.changelog-init.xml"/>
</databaseChangeLog>

View File

@ -0,0 +1,56 @@
<?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">
<changeSet author="R3.Corda" id="1511451595465-6">
<createTable tableName="node_bft_committed_states">
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consuming_input_index" type="INT"/>
<column name="consuming_transaction_id" type="NVARCHAR(255)"/>
<column name="requesting_party_name" type="NVARCHAR(255)"/>
<column name="requesting_party_key" type="varbinary(255)"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-16">
<createTable tableName="node_notary_commit_log">
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consuming_input_index" type="INT"/>
<column name="consuming_transaction_id" type="NVARCHAR(255)"/>
<column name="requesting_party_name" type="NVARCHAR(255)"/>
<column name="requesting_party_key" type="varbinary(255)"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-18">
<createTable tableName="node_raft_committed_states">
<column name="id" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="state_index" type="BIGINT"/>
<column name="state_value" type="blob"/>
</createTable>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-31">
<addPrimaryKey columnNames="output_index, transaction_id" constraintName="node_bft_committed_states_pkey"
tableName="node_bft_committed_states"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-41">
<addPrimaryKey columnNames="output_index, transaction_id" constraintName="node_notary_commit_log_pkey"
tableName="node_notary_commit_log"/>
</changeSet>
<changeSet author="R3.Corda" id="1511451595465-43">
<addPrimaryKey columnNames="id" constraintName="node_raft_comm_states_pkey"
tableName="node_raft_committed_states"/>
</changeSet>
</databaseChangeLog>

View File

@ -0,0 +1,9 @@
<?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">
<include file="migration/node-notary.changelog-init.xml"/>
</databaseChangeLog>