fix(db): add missing m_saving_product_temp table causing 500 on product list APIs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
eb88fb0813
commit
9d09d9ebd4
@@ -398,4 +398,5 @@
|
||||
<include file="parts/0339_add_share_linking_enabled_to_current_account.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0340_add_terminate_true_to_savings_and_current_account.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0368_catchup_savings_account_columns.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0369_catchup_saving_product_temp_table.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+316
@@ -0,0 +1,316 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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-4.1.xsd">
|
||||
|
||||
<!--
|
||||
Catch-up: m_saving_product_temp and its satellite tables are created by the fineract-savings
|
||||
module changelog (migrations 2017-2029). In tenants where that module changelog did not run,
|
||||
these tables are absent. This migration creates them with the final post-2029 column structure
|
||||
so the savings/deposit/share product list APIs stop failing with "relation does not exist".
|
||||
Every changeSet is guarded so it is a no-op where the table already exists.
|
||||
-->
|
||||
|
||||
<!-- ===== Main pending-edit table ===== -->
|
||||
<changeSet id="0369-saving-product-temp" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_saving_product_temp"/></not>
|
||||
</preConditions>
|
||||
<createTable tableName="m_saving_product_temp">
|
||||
<!-- Core audit / status columns -->
|
||||
<column name="id" type="BIGINT" autoIncrement="true">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="product_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="product_type" type="VARCHAR(20)" defaultValue="SAVINGS">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="createdby_id" type="BIGINT">
|
||||
<constraints nullable="false" foreignKeyName="fk_spt_createdby_id" references="m_appuser(id)"/>
|
||||
</column>
|
||||
<column name="lastmodifiedby_id" type="BIGINT">
|
||||
<constraints nullable="true" foreignKeyName="fk_spt_lastmodifiedby_id" references="m_appuser(id)"/>
|
||||
</column>
|
||||
<column name="created_date" type="DATETIME">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="lastmodified_date" type="DATETIME">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="status" type="VARCHAR(20)" defaultValue="PENDING">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="reject_reason" type="VARCHAR(500)">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="pending_lock_key" type="VARCHAR(40)">
|
||||
<constraints nullable="true" unique="true" uniqueConstraintName="spt_unq_pending_lock_key"/>
|
||||
</column>
|
||||
<column name="command_source_id" type="BIGINT">
|
||||
<constraints nullable="true" foreignKeyName="fk_spt_command_source_id" references="m_portfolio_command_source(id)"/>
|
||||
</column>
|
||||
|
||||
<!-- Group 1: fields shared across Savings / Current / FD / RD -->
|
||||
<column name="name" type="VARCHAR(100)"/>
|
||||
<column name="short_name" type="VARCHAR(20)"/>
|
||||
<column name="description" type="VARCHAR(500)"/>
|
||||
<column name="currency_code" type="VARCHAR(3)"/>
|
||||
<column name="currency_digits" type="INTEGER"/>
|
||||
<column name="currency_multiplesof" type="INTEGER"/>
|
||||
<column name="accounting_type" type="INTEGER"/>
|
||||
<column name="nominal_annual_interest_rate" type="DECIMAL(19,6)"/>
|
||||
<column name="interest_compounding_period_enum" type="INTEGER"/>
|
||||
<column name="interest_posting_period_enum" type="INTEGER"/>
|
||||
<column name="interest_calculation_type_enum" type="INTEGER"/>
|
||||
<column name="interest_calculation_days_in_year_type_enum" type="INTEGER"/>
|
||||
<column name="min_required_opening_balance" type="DECIMAL(19,6)"/>
|
||||
<column name="lockin_period_frequency" type="INTEGER"/>
|
||||
<column name="lockin_period_frequency_enum" type="INTEGER"/>
|
||||
<column name="withdrawal_fee_for_transfer" type="BOOLEAN"/>
|
||||
<column name="allow_overdraft" type="BOOLEAN"/>
|
||||
<column name="overdraft_limit" type="DECIMAL(19,6)"/>
|
||||
<column name="nominal_annual_interest_rate_overdraft" type="DECIMAL(19,6)"/>
|
||||
<column name="min_overdraft_for_interest_calculation" type="DECIMAL(19,6)"/>
|
||||
<column name="enforce_min_required_balance" type="BOOLEAN"/>
|
||||
<column name="min_required_balance" type="DECIMAL(19,6)"/>
|
||||
<column name="is_lien_allowed" type="BOOLEAN"/>
|
||||
<column name="max_allowed_lien_limit" type="DECIMAL(19,6)"/>
|
||||
<column name="min_balance_for_interest_calculation" type="DECIMAL(19,6)"/>
|
||||
<column name="withhold_tax" type="BOOLEAN"/>
|
||||
<column name="tax_group_id" type="BIGINT"/>
|
||||
<column name="other_gl_mappings" type="CLOB"/>
|
||||
<column name="is_dormancy_tracking_active" type="BOOLEAN"/>
|
||||
<column name="days_to_inactive" type="INTEGER"/>
|
||||
<column name="days_to_dormancy" type="INTEGER"/>
|
||||
<column name="days_to_escheat" type="INTEGER"/>
|
||||
<column name="account_type" type="VARCHAR(50)"/>
|
||||
<column name="customer_segment" type="VARCHAR(50)"/>
|
||||
<column name="product_code" type="VARCHAR(20)"/>
|
||||
<column name="gl_account_id" type="BIGINT"/>
|
||||
<column name="effective_date" type="DATE"/>
|
||||
<column name="effective_to" type="DATE"/>
|
||||
<column name="end_date" type="DATE"/>
|
||||
<column name="introducer_required" type="BOOLEAN"/>
|
||||
<column name="share_linking_enabled" type="BOOLEAN"/>
|
||||
<column name="nomination_facility" type="BOOLEAN"/>
|
||||
<column name="dormancy_alert" type="BOOLEAN"/>
|
||||
<column name="interest_calculate_selector" type="INTEGER"/>
|
||||
<column name="average_period" type="VARCHAR(20)"/>
|
||||
<column name="auto_post" type="BOOLEAN"/>
|
||||
<column name="frequency_fix_day" type="INTEGER"/>
|
||||
<column name="last_interest_date" type="DATE"/>
|
||||
<column name="enable_lockin_period" type="BOOLEAN"/>
|
||||
<column name="balance_frequency" type="VARCHAR(50)"/>
|
||||
<column name="account_closed_zero_balance_in_day_closing" type="BOOLEAN"/>
|
||||
<column name="balance_swap_option" type="BOOLEAN"/>
|
||||
<column name="msme" type="BOOLEAN"/>
|
||||
<column name="auto_debit_facility" type="BOOLEAN"/>
|
||||
<column name="loan_facility" type="BOOLEAN"/>
|
||||
<column name="premature_withdrawal_option" type="BOOLEAN"/>
|
||||
<column name="tenure_flexibility" type="BOOLEAN"/>
|
||||
<column name="lien_marked" type="BOOLEAN"/>
|
||||
<column name="maturity_instructions" type="BOOLEAN"/>
|
||||
<column name="credit_maturity_proceeds" type="BOOLEAN"/>
|
||||
<column name="penalty_grace_period_missed_installments" type="BOOLEAN"/>
|
||||
<column name="panel_request_applicable" type="BOOLEAN"/>
|
||||
<column name="no_penalty_nominee_heir_closure" type="BOOLEAN"/>
|
||||
<column name="deceased_settlement" type="BOOLEAN"/>
|
||||
<column name="allow_debit_txn_after_due_date" type="BOOLEAN"/>
|
||||
|
||||
<!-- Group 2: Current-account-only -->
|
||||
<column name="avg_balance_calc_period" type="VARCHAR(10)"/>
|
||||
<column name="valid_for_period" type="VARCHAR(10)"/>
|
||||
<column name="od_account_closed_zero_balance_in_day_closing" type="BOOLEAN"/>
|
||||
|
||||
<!-- Group 3: Share-product-only (final column names after 2028 rename) -->
|
||||
<column name="total_shares" type="BIGINT"/>
|
||||
<column name="issued_shares" type="BIGINT"/>
|
||||
<column name="unit_price" type="DECIMAL(19,6)"/>
|
||||
<column name="minimum_client_shares" type="BIGINT"/>
|
||||
<column name="nominal_client_shares" type="BIGINT"/>
|
||||
<column name="maximum_client_shares" type="BIGINT"/>
|
||||
<column name="allow_dividends_inactive_clients" type="BOOLEAN"/>
|
||||
<column name="minimum_active_period_frequency" type="INTEGER"/>
|
||||
<column name="minimum_active_period_frequency_enum" type="INTEGER"/>
|
||||
<column name="share_lockin_period" type="INTEGER"/>
|
||||
<column name="share_lockin_period_frequency_type" type="INTEGER"/>
|
||||
|
||||
<!-- Group 4: Fixed-Deposit-only -->
|
||||
<column name="fd_type" type="VARCHAR(20)"/>
|
||||
<column name="pre_closure_penal_applicable" type="BOOLEAN"/>
|
||||
<column name="pre_closure_penal_interest" type="DECIMAL(19,6)"/>
|
||||
<column name="pre_closure_penal_interest_on_type_id" type="INTEGER"/>
|
||||
<column name="min_deposit_term" type="INTEGER"/>
|
||||
<column name="max_deposit_term" type="INTEGER"/>
|
||||
<column name="min_deposit_term_type_id" type="INTEGER"/>
|
||||
<column name="max_deposit_term_type_id" type="INTEGER"/>
|
||||
<column name="in_multiples_of_deposit_term" type="INTEGER"/>
|
||||
<column name="in_multiples_of_deposit_term_type_id" type="INTEGER"/>
|
||||
<column name="min_deposit_amount" type="DECIMAL(19,6)"/>
|
||||
<column name="max_deposit_amount" type="DECIMAL(19,6)"/>
|
||||
<column name="deposit_amount" type="DECIMAL(19,6)"/>
|
||||
|
||||
<!-- Group 5: Recurring-Deposit-only -->
|
||||
<column name="is_mandatory_deposit" type="BOOLEAN"/>
|
||||
<column name="allow_withdrawal" type="BOOLEAN"/>
|
||||
<column name="adjust_advance_towards_future_payments" type="BOOLEAN"/>
|
||||
|
||||
<!-- Group 6: Account facility config (fc_ prefix) -->
|
||||
<column name="fc_atm_facility" type="BOOLEAN"/>
|
||||
<column name="fc_atm_withdrawal_facility" type="BOOLEAN"/>
|
||||
<column name="fc_upi_facility" type="BOOLEAN"/>
|
||||
<column name="fc_pos_transactions_facility" type="BOOLEAN"/>
|
||||
<column name="fc_cheque_book" type="BOOLEAN"/>
|
||||
<column name="fc_imps_facility" type="BOOLEAN"/>
|
||||
<column name="fc_sms_alerts" type="BOOLEAN"/>
|
||||
<column name="fc_bbps_facility" type="BOOLEAN"/>
|
||||
<column name="fc_insurance_cover" type="BOOLEAN"/>
|
||||
<column name="fc_bepg_facility" type="BOOLEAN"/>
|
||||
<column name="fc_neft_facility" type="BOOLEAN"/>
|
||||
<column name="fc_rtgs_facility" type="BOOLEAN"/>
|
||||
<column name="fc_inter_bank_total_cap_facility" type="BOOLEAN"/>
|
||||
<column name="fc_withdrawal_facility" type="BOOLEAN"/>
|
||||
<column name="fc_deposit_facility_kyc" type="BOOLEAN"/>
|
||||
<column name="fc_virtual_debit_card" type="BOOLEAN"/>
|
||||
|
||||
<!-- Group 7: Deposit limit KYC (kyc_ prefix) -->
|
||||
<column name="kyc_general_type" type="VARCHAR(50)"/>
|
||||
<column name="kyc_general_limit" type="VARCHAR(50)"/>
|
||||
<column name="kyc_minor_type" type="VARCHAR(50)"/>
|
||||
<column name="kyc_minor_limit" type="BIGINT"/>
|
||||
<column name="kyc_small_saving_type" type="VARCHAR(50)"/>
|
||||
<column name="kyc_small_saving_limit" type="BIGINT"/>
|
||||
|
||||
<!-- Group 8: GL account mapping scalar ids (gl_ prefix) -->
|
||||
<column name="gl_savings_reference_account_id" type="BIGINT"/>
|
||||
<column name="gl_savings_control_account_id" type="BIGINT"/>
|
||||
<column name="gl_income_from_fee_account_id" type="BIGINT"/>
|
||||
<column name="gl_income_from_penalty_account_id" type="BIGINT"/>
|
||||
<column name="gl_interest_on_savings_account_id" type="BIGINT"/>
|
||||
<column name="gl_transfers_in_suspense_account_id" type="BIGINT"/>
|
||||
<column name="gl_overdraft_portfolio_control_id" type="BIGINT"/>
|
||||
<column name="gl_income_from_interest_id" type="BIGINT"/>
|
||||
<column name="gl_write_off_account_id" type="BIGINT"/>
|
||||
<column name="gl_escheat_liability_id" type="BIGINT"/>
|
||||
<column name="gl_penalties_receivable_account_id" type="BIGINT"/>
|
||||
<column name="gl_interest_receivable_account_id" type="BIGINT"/>
|
||||
<column name="gl_fees_receivable_account_id" type="BIGINT"/>
|
||||
<column name="gl_interest_payable_account_id" type="BIGINT"/>
|
||||
|
||||
<!-- Additional columns from 2028-add-missing-columns -->
|
||||
<column name="deposit_type_enum" type="SMALLINT"/>
|
||||
<column name="withdrawal_fee_amount" type="DECIMAL(19,6)"/>
|
||||
<column name="withdrawal_fee_type_enum" type="SMALLINT"/>
|
||||
<column name="external_id" type="VARCHAR(100)"/>
|
||||
<column name="start_date" type="DATE"/>
|
||||
<column name="totalsubscribed_shares" type="BIGINT"/>
|
||||
<column name="capital_amount" type="DECIMAL(20,2)"/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<!-- ===== Satellite table: pending edit charges ===== -->
|
||||
<changeSet id="0369-product-temp-charge" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_product_temp_charge"/></not>
|
||||
</preConditions>
|
||||
<createTable tableName="m_product_temp_charge">
|
||||
<column name="id" type="BIGINT" autoIncrement="true">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="pending_edit_id" type="BIGINT">
|
||||
<constraints nullable="false" foreignKeyName="fk_ptc_pending_edit_id" references="m_saving_product_temp(id)"/>
|
||||
</column>
|
||||
<column name="charge_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<!-- ===== Satellite table: pending edit facility limits ===== -->
|
||||
<changeSet id="0369-product-temp-facility-limit" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_product_temp_facility_limit"/></not>
|
||||
</preConditions>
|
||||
<createTable tableName="m_product_temp_facility_limit">
|
||||
<column name="id" type="BIGINT" autoIncrement="true">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="pending_edit_id" type="BIGINT">
|
||||
<constraints nullable="false" foreignKeyName="fk_ptfl_pending_edit_id" references="m_saving_product_temp(id)"/>
|
||||
</column>
|
||||
<column name="limit_type" type="VARCHAR(100)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="general_limit" type="VARCHAR(50)"/>
|
||||
<column name="minor_account_limit" type="VARCHAR(50)"/>
|
||||
<column name="small_saving_limit" type="VARCHAR(50)"/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<!-- ===== Satellite table: pending edit GL mappings ===== -->
|
||||
<changeSet id="0369-product-temp-gl-mapping" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_product_temp_gl_mapping"/></not>
|
||||
</preConditions>
|
||||
<createTable tableName="m_product_temp_gl_mapping">
|
||||
<column name="id" type="BIGINT" autoIncrement="true">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="pending_edit_id" type="BIGINT">
|
||||
<constraints nullable="false" foreignKeyName="fk_ptgm_pending_edit_id" references="m_saving_product_temp(id)"/>
|
||||
</column>
|
||||
<column name="mapping_type" type="VARCHAR(30)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="payment_type_id" type="BIGINT"/>
|
||||
<column name="charge_id" type="BIGINT"/>
|
||||
<column name="gl_account_id" type="BIGINT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<!-- ===== Satellite table: pending edit share market prices ===== -->
|
||||
<changeSet id="0369-product-temp-share-market-price" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_product_temp_share_market_price"/></not>
|
||||
</preConditions>
|
||||
<createTable tableName="m_product_temp_share_market_price">
|
||||
<column name="id" type="BIGINT" autoIncrement="true">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="pending_edit_id" type="BIGINT">
|
||||
<constraints nullable="false" foreignKeyName="fk_ptsmp_pending_edit_id" references="m_saving_product_temp(id)"/>
|
||||
</column>
|
||||
<column name="source_id" type="BIGINT"/>
|
||||
<column name="delete_flag" type="BOOLEAN" defaultValueBoolean="false">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="from_date" type="DATE"/>
|
||||
<column name="share_value" type="DECIMAL(19,6)"/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<!-- ===== Satellite table: submitted field manifest ===== -->
|
||||
<changeSet id="0369-product-temp-submitted-field" author="CBS">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not><tableExists tableName="m_product_temp_submitted_field"/></not>
|
||||
</preConditions>
|
||||
<createTable tableName="m_product_temp_submitted_field">
|
||||
<column name="id" type="BIGINT" autoIncrement="true">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="pending_edit_id" type="BIGINT">
|
||||
<constraints nullable="false" foreignKeyName="fk_ptsf_pending_edit_id" references="m_saving_product_temp(id)"/>
|
||||
</column>
|
||||
<column name="field_name" type="VARCHAR(100)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
<addUniqueConstraint tableName="m_product_temp_submitted_field" columnNames="pending_edit_id, field_name"
|
||||
constraintName="ptsf_unq_pending_edit_field"/>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user