ENT-2430 Swap over output_index and transaction_id in database indexes (#1354)

(cherry picked from commit 2d33ba3)
This commit is contained in:
Rick Parker 2018-08-23 16:24:56 +01:00 committed by GitHub
parent 759419fcc1
commit 79909a5ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 138 additions and 6 deletions

View File

@ -9,9 +9,12 @@
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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" >
<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">
<include file="migration/cash.changelog-init.xml"/>
<include file="migration/cash.changelog-v1.xml"/>
<include file="migration/cash.changelog-pkey.xml"/>
</databaseChangeLog>

View File

@ -0,0 +1,12 @@
<?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"
logicalFilePath="migration/node-services.changelog-init.xml">
<changeSet id="non-clustered_pk-cash-swap" author="R3.Corda" onValidationFail="MARK_RAN">
<dropPrimaryKey tableName="contract_cash_states" constraintName="contract_cash_states_pkey"/>
<addPrimaryKey tableName="contract_cash_states" columnNames="transaction_id, output_index"
constraintName="contract_cash_states_pkey" clustered="false"/>
</changeSet>
</databaseChangeLog>

View File

@ -9,9 +9,12 @@
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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">
<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">
<include file="migration/commercial-paper.changelog-init.xml"/>
<include file="migration/commercial-paper.changelog-v1.xml"/>
<include file="migration/commercial-paper.changelog-pkey.xml"/>
</databaseChangeLog>

View File

@ -0,0 +1,20 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<!--
~ R3 Proprietary and Confidential
~
~ Copyright (c) 2018 R3 Limited. All rights reserved.
~
~ The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law.
~
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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 id="non-clustered_pk-commercial-paper-swap" author="R3.Corda" onValidationFail="MARK_RAN">
<dropPrimaryKey tableName="cp_states" constraintName="cp_states_pkey"/>
<addPrimaryKey tableName="cp_states" columnNames="transaction_id, output_index" constraintName="cp_states_pkey"
clustered="false"/>
</changeSet>
</databaseChangeLog>

View File

@ -10,13 +10,14 @@
-->
<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"/>
<include file="migration/vault-schema.changelog-v4.xml"/>
<include file="migration/vault-schema.changelog-pkey.xml"/>
<include file="migration/vault-schema.changelog-v5.xml"/>
<include file="migration/vault-schema.changelog-pkey-swap.xml"/>
</databaseChangeLog>

View File

@ -0,0 +1,46 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<!--
~ R3 Proprietary and Confidential
~
~ Copyright (c) 2018 R3 Limited. All rights reserved.
~
~ The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law.
~
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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 id="non-clustered_pk-14" author="R3.Corda" onValidationFail="MARK_RAN">
<dropForeignKeyConstraint baseTableName="vault_fungible_states_parts"
constraintName="FK__fung_st_parts__fung_st"/>
<dropPrimaryKey tableName="vault_fungible_states" constraintName="vault_fungible_states_pkey"/>
<addPrimaryKey tableName="vault_fungible_states" columnNames="transaction_id, output_index"
constraintName="vault_fungible_states_pkey" clustered="false"/>
<addForeignKeyConstraint baseColumnNames="transaction_id,output_index"
baseTableName="vault_fungible_states_parts"
constraintName="FK__fung_st_parts__fung_st"
referencedColumnNames="transaction_id,output_index"
referencedTableName="vault_fungible_states"/>
</changeSet>
<changeSet id="non-clustered_pk-15" author="R3.Corda" onValidationFail="MARK_RAN">
<dropForeignKeyConstraint baseTableName="vault_linear_states_parts"
constraintName="FK__lin_stat_parts__lin_stat"/>
<dropPrimaryKey tableName="vault_linear_states" constraintName="vault_linear_states_pkey"/>
<addPrimaryKey tableName="vault_linear_states" columnNames="transaction_id, output_index"
constraintName="vault_linear_states_pkey" clustered="false"/>
<addForeignKeyConstraint baseColumnNames="transaction_id,output_index" baseTableName="vault_linear_states_parts"
constraintName="FK__lin_stat_parts__lin_stat"
referencedColumnNames="transaction_id,output_index"
referencedTableName="vault_linear_states"/>
</changeSet>
<changeSet id="non-clustered_pk-16" author="R3.Corda" onValidationFail="MARK_RAN">
<dropPrimaryKey tableName="vault_states" constraintName="vault_states_pkey"/>
<addPrimaryKey tableName="vault_states" columnNames="transaction_id, output_index"
constraintName="vault_states_pkey" clustered="false"/>
</changeSet>
</databaseChangeLog>

View File

@ -9,8 +9,11 @@
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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" >
<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">
<include file="migration/cash-pt.changelog-init.xml"/>
<include file="migration/cash-pt.changelog-pkey.xml"/>
</databaseChangeLog>

View File

@ -0,0 +1,20 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<!--
~ R3 Proprietary and Confidential
~
~ Copyright (c) 2018 R3 Limited. All rights reserved.
~
~ The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law.
~
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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 id="non-clustered_pk-cash-pt-swap" author="R3.Corda" onValidationFail="MARK_RAN">
<dropPrimaryKey tableName="contract_pt_cash_states" constraintName="contract_pt_cash_states_pkey"/>
<addPrimaryKey tableName="contract_pt_cash_states" columnNames="transaction_id, output_index"
constraintName="contract_pt_cash_states_pkey" clustered="false"/>
</changeSet>
</databaseChangeLog>

View File

@ -9,8 +9,11 @@
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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">
<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">
<include file="migration/commercial-paper-pt.changelog-init.xml"/>
<include file="migration/commercial-paper-pt.changelog-pkey.xml"/>
</databaseChangeLog>

View File

@ -0,0 +1,21 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<!--
~ R3 Proprietary and Confidential
~
~ Copyright (c) 2018 R3 Limited. All rights reserved.
~
~ The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law.
~
~ Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited.
-->
<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 id="non-clustered_pk_pt-commercial-paper-swap" author="R3.Corda" onValidationFail="MARK_RAN">
<dropPrimaryKey tableName="cp_pt_states" constraintName="cp_pt_states_pkey"/>
<addPrimaryKey tableName="cp_pt_states" columnNames="transaction_id, output_index"
constraintName="cp_pt_states_pkey" clustered="false"/>
</changeSet>
</databaseChangeLog>