|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +
|
| 4 | + Licensed to the Apache Software Foundation (ASF) under one |
| 5 | + or more contributor license agreements. See the NOTICE file |
| 6 | + distributed with this work for additional information |
| 7 | + regarding copyright ownership. The ASF licenses this file |
| 8 | + to you under the Apache License, Version 2.0 (the |
| 9 | + "License"); you may not use this file except in compliance |
| 10 | + with the License. You may obtain a copy of the License at |
| 11 | +
|
| 12 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +
|
| 14 | + Unless required by applicable law or agreed to in writing, |
| 15 | + software distributed under the License is distributed on an |
| 16 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 17 | + KIND, either express or implied. See the License for the |
| 18 | + specific language governing permissions and limitations |
| 19 | + under the License. |
| 20 | +
|
| 21 | +--> |
| 22 | +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" |
| 23 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 24 | + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"> |
| 25 | + <changeSet author="fineract" id="1" context="postgresql"> |
| 26 | + <createTable tableName="m_loan_buy_down_fee_balance"> |
| 27 | + <column autoIncrement="true" name="id" type="BIGINT"> |
| 28 | + <constraints nullable="false" primaryKey="true" primaryKeyName="pk_m_loan_buy_down_fee_balance"/> |
| 29 | + </column> |
| 30 | + <column name="version" type="BIGINT"> |
| 31 | + <constraints nullable="false"/> |
| 32 | + </column> |
| 33 | + <column name="loan_id" type="BIGINT"> |
| 34 | + <constraints nullable="false"/> |
| 35 | + </column> |
| 36 | + <column name="loan_transaction_id" type="BIGINT"> |
| 37 | + <constraints nullable="false"/> |
| 38 | + </column> |
| 39 | + <column name="amount" type="DECIMAL(19, 6)"> |
| 40 | + <constraints nullable="false"/> |
| 41 | + </column> |
| 42 | + <column name="date" type="DATE"> |
| 43 | + <constraints nullable="false"/> |
| 44 | + </column> |
| 45 | + <column name="unrecognized_amount" type="DECIMAL(19, 6)"> |
| 46 | + <constraints nullable="false"/> |
| 47 | + </column> |
| 48 | + <column name="charged_off_amount" type="DECIMAL(19, 6)" /> |
| 49 | + <column name="amount_adjustment" type="DECIMAL(19, 6)" /> |
| 50 | + <column name="created_by" type="BIGINT"/> |
| 51 | + <column name="created_on_utc" type="timestamp with time zone"/> |
| 52 | + <column name="last_modified_by" type="BIGINT"/> |
| 53 | + <column name="last_modified_on_utc" type="timestamp with time zone"/> |
| 54 | + </createTable> |
| 55 | + </changeSet> |
| 56 | + <changeSet author="fineract" id="2" context="mysql"> |
| 57 | + <createTable tableName="m_loan_buy_down_fee_balance"> |
| 58 | + <column autoIncrement="true" name="id" type="BIGINT"> |
| 59 | + <constraints nullable="false" primaryKey="true" primaryKeyName="pk_m_loan_buy_down_fee_balance"/> |
| 60 | + </column> |
| 61 | + <column name="version" type="BIGINT"> |
| 62 | + <constraints nullable="false"/> |
| 63 | + </column> |
| 64 | + <column name="loan_id" type="BIGINT"> |
| 65 | + <constraints nullable="false"/> |
| 66 | + </column> |
| 67 | + <column name="loan_transaction_id" type="BIGINT"> |
| 68 | + <constraints nullable="false"/> |
| 69 | + </column> |
| 70 | + <column name="amount" type="DECIMAL(19, 6)"> |
| 71 | + <constraints nullable="false"/> |
| 72 | + </column> |
| 73 | + <column name="date" type="DATE"> |
| 74 | + <constraints nullable="false"/> |
| 75 | + </column> |
| 76 | + <column name="unrecognized_amount" type="DECIMAL(19, 6)"> |
| 77 | + <constraints nullable="false"/> |
| 78 | + </column> |
| 79 | + <column name="charged_off_amount" type="DECIMAL(19, 6)" /> |
| 80 | + <column name="amount_adjustment" type="DECIMAL(19, 6)" /> |
| 81 | + <column name="created_by" type="BIGINT"/> |
| 82 | + <column name="created_on_utc" type="DATETIME"/> |
| 83 | + <column name="last_modified_by" type="BIGINT"/> |
| 84 | + <column name="last_modified_on_utc" type="DATETIME"/> |
| 85 | + </createTable> |
| 86 | + </changeSet> |
| 87 | + <changeSet author="fineract" id="3"> |
| 88 | + <addForeignKeyConstraint baseColumnNames="created_by" baseTableName="m_loan_buy_down_fee_balance" |
| 89 | + constraintName="FK_loan_buy_down_fees_balance_created_by" deferrable="false" initiallyDeferred="false" |
| 90 | + onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id" |
| 91 | + referencedTableName="m_appuser" validate="true"/> |
| 92 | + <addForeignKeyConstraint baseColumnNames="last_modified_by" baseTableName="m_loan_buy_down_fee_balance" |
| 93 | + constraintName="FK_loan_buy_down_fees_balance_last_modified_by" deferrable="false" initiallyDeferred="false" |
| 94 | + onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id" |
| 95 | + referencedTableName="m_appuser" validate="true"/> |
| 96 | + <addForeignKeyConstraint baseColumnNames="loan_id" baseTableName="m_loan_buy_down_fee_balance" |
| 97 | + constraintName="FK_loan_buy_down_fees_balance_loan_id" deferrable="false" initiallyDeferred="false" |
| 98 | + onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id" |
| 99 | + referencedTableName="m_loan" validate="true"/> |
| 100 | + <addForeignKeyConstraint baseColumnNames="loan_transaction_id" baseTableName="m_loan_buy_down_fee_balance" |
| 101 | + constraintName="FK_loan_buy_down_fees_balance_transaction_id" deferrable="false" initiallyDeferred="false" |
| 102 | + onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id" |
| 103 | + referencedTableName="m_loan_transaction" validate="true"/> |
| 104 | + </changeSet> |
| 105 | + <changeSet author="fineract" id="4" runInTransaction="false" context="postgresql"> |
| 106 | + <sql> |
| 107 | + create unique index concurrently if not exists m_loan_buy_down_fee_balance_idx_1 on m_loan_buy_down_fee_balance(loan_id,loan_transaction_id); |
| 108 | + create index concurrently if not exists m_loan_buy_down_fee_balance_idx_2 on m_loan_buy_down_fee_balance(loan_id); |
| 109 | + </sql> |
| 110 | + </changeSet> |
| 111 | + <changeSet author="fineract" id="5" context="mysql"> |
| 112 | + <sql> |
| 113 | + create unique index m_loan_buy_down_fee_balance_idx_1 on m_loan_buy_down_fee_balance(loan_id,loan_transaction_id); |
| 114 | + create index m_loan_buy_down_fee_balance_idx_2 on m_loan_buy_down_fee_balance(loan_id); |
| 115 | + </sql> |
| 116 | + </changeSet> |
| 117 | +</databaseChangeLog> |
0 commit comments