<?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 id="non-clustered_pk-11" 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="output_index, transaction_id"
                       constraintName="vault_fungible_states_pkey" clustered="false"/>
        <addForeignKeyConstraint baseColumnNames="output_index,transaction_id"
                                 baseTableName="vault_fungible_states_parts"
                                 constraintName="FK__fung_st_parts__fung_st"
                                 referencedColumnNames="output_index,transaction_id"
                                 referencedTableName="vault_fungible_states"/>
    </changeSet>
    <changeSet id="non-clustered_pk-12" 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="output_index, transaction_id"
                       constraintName="vault_linear_states_pkey" clustered="false"/>
        <addForeignKeyConstraint baseColumnNames="output_index,transaction_id" baseTableName="vault_linear_states_parts"
                                 constraintName="FK__lin_stat_parts__lin_stat"
                                 referencedColumnNames="output_index,transaction_id"
                                 referencedTableName="vault_linear_states"/>
    </changeSet>
    <changeSet id="non-clustered_pk-13" author="R3.Corda" onValidationFail="MARK_RAN">
        <dropPrimaryKey tableName="vault_states" constraintName="vault_states_pkey"/>
        <addPrimaryKey tableName="vault_states" columnNames="output_index, transaction_id"
                       constraintName="vault_states_pkey" clustered="false"/>
    </changeSet>

</databaseChangeLog>

