FINERACT-1670: Add auditable fields to Calendar
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
e47e2cd1e3
commit
656ecdef9f
@@ -52,5 +52,7 @@
|
||||
<include file="parts/0030_add_audit_entries_to_business_date.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0031_add_audit_entries_to_client_identifier.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0032_add_some_missing_indexes.xml" relativeToChangelogFile="true"/>
|
||||
>>>>>>> 92a62bc2d (FINERACT-1670: Add some missing indexes)
|
||||
<include file="parts/0033_add_audit_entries_to_loan_repayment_schedule_installment.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0034_add_audit_entries_to_note.xml" relativeToChangelogFile="true"/>
|
||||
<include file="parts/0035_add_audit_entries_to_calendar.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
-->
|
||||
<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.3.xsd">
|
||||
<changeSet author="fineract" id="calendar-1" context="mysql">
|
||||
<addColumn tableName="m_calendar">
|
||||
<column name="created_on_utc" type="DATETIME"/>
|
||||
<column name="last_modified_on_utc" type="DATETIME"/>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
<changeSet author="fineract" id="calendar-1" context="postgresql">
|
||||
<addColumn tableName="m_calendar">
|
||||
<column name="created_on_utc" type="TIMESTAMP WITH TIME ZONE"/>
|
||||
<column name="last_modified_on_utc" type="TIMESTAMP WITH TIME ZONE"/>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="calendar-2" author="fineract">
|
||||
<dropNotNullConstraint tableName="m_calendar" columnName="created_date" columnDataType="datetime"/>
|
||||
<dropNotNullConstraint tableName="m_calendar" columnName="lastmodified_date" columnDataType="datetime"/>
|
||||
</changeSet>
|
||||
<changeSet id="calendar-3" author="fineract">
|
||||
<renameColumn tableName="m_calendar" oldColumnName="createdby_id" newColumnName="created_by" columnDataType="BIGINT"/>
|
||||
<renameColumn tableName="m_calendar" oldColumnName="lastmodifiedby_id" newColumnName="last_modified_by" columnDataType="BIGINT"/>
|
||||
</changeSet>
|
||||
<changeSet author="fineract" id="calendar-4">
|
||||
<addForeignKeyConstraint baseColumnNames="created_by" baseTableName="m_calendar"
|
||||
constraintName="FK_calendar_created_by" deferrable="false" initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
<addForeignKeyConstraint baseColumnNames="last_modified_by" baseTableName="m_calendar"
|
||||
constraintName="FK_calendar_last_modified_by" deferrable="false" initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
</changeSet>
|
||||
<changeSet id="calendar-5" author="fineract" context="mysql">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">select count(*) from m_calendar</sqlCheck>
|
||||
</preConditions>
|
||||
<addNotNullConstraint tableName="m_calendar" columnName="created_on_utc" columnDataType="DATETIME"/>
|
||||
<addNotNullConstraint tableName="m_calendar" columnName="last_modified_on_utc" columnDataType="DATETIME"/>
|
||||
</changeSet>
|
||||
<changeSet id="calendar-5" author="fineract" context="postgresql">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">select count(*) from m_calendar</sqlCheck>
|
||||
</preConditions>
|
||||
<addNotNullConstraint tableName="m_calendar" columnName="created_on_utc" columnDataType="TIMESTAMP WITH TIME ZONE"/>
|
||||
<addNotNullConstraint tableName="m_calendar" columnName="last_modified_on_utc" columnDataType="TIMESTAMP WITH TIME ZONE"/>
|
||||
</changeSet>
|
||||
<changeSet id="calendar-6" author="fineract">
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<sqlCheck expectedResult="0">select count(*) from m_calendar where created_by is null or last_modified_by is null</sqlCheck>
|
||||
</preConditions>
|
||||
<addNotNullConstraint tableName="m_calendar" columnName="created_by" columnDataType="BIGINT"/>
|
||||
<addNotNullConstraint tableName="m_calendar" columnName="last_modified_by" columnDataType="BIGINT"/>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user