@AnuragEQX sorry, I should have asked what is the exact command you used to run liquibase.
ex.
liquibase update
As I understand here is the process:
- you run liquibase command (assuming liquibase update)
- using the following changeset
<?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" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet author="GujarKu" id="MVL" logicalFilePath="view_alloc_payroll_tax_info.sql" runOnChange="true" runAlways="false" failOnError="false">
<comment>335497-EPD38346DDL request for EPD35926 Alter table ALLOCPAYROLLTAXINFODT</comment>
<sqlFile path="../materialized_views/view_alloc_payroll_tax_info.sql" relativeToChangelogFile="true" splitStatements="true" endDelimiter="\n/" encoding="utf8"/>
</changeSet>
<changeSet author="RathiRo" id="MVL" logicalFilePath="view_booking_entity_rules_setup.sql" runOnChange="true" runAlways="false" failOnError="false">
<comment>339488-EPD41370 update view for newly added column</comment>
<sqlFile path="../materialized_views/view_booking_entity_rules_setup.sql" relativeToChangelogFile="true" splitStatements="true" endDelimiter="\n/" encoding="utf8"/>
</changeSet>
</databaseChangeLog>
- which produces the below output
11:11:17.572 [main] INFO liquibase.executor.jvm.JdbcExecutor - [ EQX ]1 row(s) affected
11:11:17.627 [main] INFO liquibase.executor.jvm.JdbcExecutor - --REM /***************************************************
*****************
--REM
--REM Copyright (c) 2006 EES, UBS AG
--REM
--REM File Name : view_booking_entity_rules_setup.sql
--REM
--REM Version Date Who Comments
--REM *********************************************************************
--REM Release 37.5
--REM 37.5.1 15.03.2018 ShaikhDi EPD-16295 : Creation
--REM Release 42.5
--REM 42.5.1 26.02.2019 GargAy EPD-23993 : Column ADDED
--REM Release 48.5
--REM 48.5.1 25.05.2020 RathiRo EPD-41370 : Column added
BEGIN
EXECUTE IMMEDIATE 'DROP SYNONYM booking_entity_rules_setup';
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
11:11:17.630 [main] INFO liquibase.executor.jvm.JdbcExecutor - [ EQX ]-1 row(s) affected
11:11:17.631 [main] INFO liquibase.executor.jvm.JdbcExecutor - DECLARE
k_template_company CONSTANT VARCHAR2(30) := 'AE9_TEMPLATE_COMPANY';
v_company_id ae9_common_data.companies.company_id%TYPE;
v_schema VARCHAR2(30) := sys_context('USERENV','CURRENT_SCHEMA');
CURSOR get_company_id_cur( c_company_short_id companies.company_short_id%TYPE)
IS SELECT company_id
FROM v_company_list
WHERE company_short_id = c_company_short_id;
BEGIN
IF v_schema = k_template_company THEN
v_company_id := '000';
ELSE
OPEN get_company_id_cur(c_company_short_id => SUBSTR(v_schema,-3));
FETCH get_company_id_cur INTO v_company_id;
CLOSE get_company_id_cur;
END IF;
BEGIN
EXECUTE IMMEDIATE 'CREATE OR REPLACE FORCE VIEW booking_entity_rules_setup
AS
SELECT
RULE_ID
,BOOKED_UNDER
,SETUP_TYPE
,LEGAL_ENTITY
,BOOKING_ENTITY
,COMPANY_ID
,ACTIVITY
,OBJECT_TIMESTAMP
,CRE_DATE
,CRE_USER
,UPD_DATE
,UPD_USER
,CRE_ORACLE_USER
,CRE_OS_USER
,UPD_ORACLE_USER
,UPD_OS_USER
,STATUS
,PLAN_TYPE
FROM (SELECT RULE_ID
,BOOKED_UNDER
,SETUP_TYPE
,LEGAL_ENTITY
,BOOKING_ENTITY
,COMPANY_ID
,ACTIVITY
,OBJECT_TIMESTAMP
,CRE_DATE
,CRE_USER
,UPD_DATE
,UPD_USER
,CRE_ORACLE_USER
,CRE_OS_USER
,UPD_ORACLE_USER
,UPD_OS_USER
,STATUS
,PLAN_TYPE
,DENSE_RANK()
OVER (
PARTITION BY bers.booked_under,bers.set
up_type,bers.legal_entity
ORDER BY
CASE
WHEN bers.company_id = ''
'||v_company_id||''' THEN 1
ELSE 2
END)
rnk
FROM ae9_common_data.booking_entity_rules_setup bers
WHERE bers.company_id IN ('''||v_company_id||''', ''ALL_
COMPANIES''))
WHERE rnk=1';
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SUBSTR(sqlerrm,1,255));
app_dba_install_logs.insert_liquibase_error_log('booking_entity_rules_setup','ERROR = '||SQLERRM,sys_context( 'US
ERENV','CURRENT_SCHEMA'));
END;
EXCEPTION
WHEN OTHERS THEN NULL;
END;
11:11:17.759 [main] INFO liquibase.executor.jvm.JdbcExecutor - [ EQX ]-1 row(s) affected
11:11:17.760 [main] INFO liquibase.executor.jvm.JdbcExecutor - COMMIT
11:11:17.761 [main] INFO liquibase.executor.jvm.JdbcExecutor - [ EQX ]0 row(s) affected
11:11:17.761 [main] INFO liquibase.changelog.ChangeSet - SQL in file ../materialized_views/view_booking_entity_rules_setu
p.sql executed
11:11:17.761 [main] INFO liquibase.changelog.ChangeSet - ChangeSet view_booking_entity_rules_setup.sql::MVL::RathiRo ran
successfully in 141ms
11:11:17.763 [main] INFO liquibase.executor.jvm.JdbcExecutor - INSERT INTO AE9_COMPANY_UBS.DATABASECHANGELOG (ID, AUTHOR,
FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_
ID) VALUES ('MVL', 'RathiRo', 'view_booking_entity_rules_setup.sql', SYSTIMESTAMP, 1240, '8:2d43e08147cf31b98229b204f2d0d
bba', 'sqlFile', '339488-EPD41370 update view for newly added column', 'EXECUTED', NULL, NULL, '3.6.2.2', '3249075780')
11:11:17.765 [main] INFO liquibase.executor.jvm.JdbcExecutor - [ EQX ]1 row(s) affected
- after this run, your dbchangelog table looks like this:
SQL> select * from ae9_company_ubs.databasechangelog where filename='view_booking_entity_rules_setup.sql' and tag='REL48_5_ORACLE_079_000'
ID AUTHOR FILENAME DATEEXECUTED ORDEREXECUTED
---------- --------------- -------------------------------------------------- -------------------------------------------------- -------------
EXECTYPE MD5SUM DESCRIPTION
---------- ----------------------------------- --------------------------------------------------
COMMENTS
------------------------------------------------------------------------------------------------------------------------------------------------------
TAG
------------------------------------------------------------------------------------------------------------------------------------------------------
LIQUIBASE
--------------------
CONTEXTS
------------------------------------------------------------------------------------------------------------------------------------------------------
LABELS
------------------------------------------------------------------------------------------------------------------------------------------------------
DEPLOYMENT_ID
-------------
MVL RathiRo view_booking_entity_rules_setup.sql 29.05.2020 06:46:30.817034 2420
EXECUTED 8:2d43e08147cf31b98229b204f2d0dbba sqlFile
339488-EPD41370 update view for newly added column
REL48_5_ORACLE_079_000
3.6.2.2
From your output, I have cut the following out:
11:11:17.761 [main] INFO liquibase.changelog.ChangeSet - ChangeSet view_booking_entity_rules_setup.sql::MVL::RathiRo ran
successfully in 141ms
So it looks like the changeset ran, and so it should have an entry in the dbchangelog table, and that is intended behavior. Am I missing something?
Thanks,
Ronak