Merge pull request #379 from corda/colljos-schema-split-for-notaries

CORDA-917 Bootstrap nodes without Notary schemas
This commit is contained in:
josecoll 2018-01-23 09:16:39 +00:00 committed by GitHub
commit d2795954cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 52 deletions

View File

@ -48,7 +48,7 @@ class NodeSchemaService(extraSchemas: Set<MappedSchema> = emptySet(), includeNot
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
@ -59,7 +59,9 @@ class NodeSchemaService(extraSchemas: Set<MappedSchema> = emptySet(), includeNot
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
private val requiredSchemas: Map<MappedSchema, SchemaService.SchemaOptions> =

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>