A sql view with block comments containing
– Comments :
had run successfully in Liquibase 4.3.5. We are trying to migrate to new version of Liquibase 4.25.1. We are getting the error
liquibase.exception.SetupException: Unexpected formatting in formatted changelog ‘<FILE_NAME_REMOVED>sql’ at line 16. Formatted SQL changelogs require known formats, such as '–comment ’ and others to be recognized and run. Learn all the options at Example Changelogs: SQL Format at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:756) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:508) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:390) at
Steps To Reproduce
Input file:
–liquibase formatted sql
–never change the value of author:changsetid
–changeset views:VW_DIM stripComments:false runOnChange:true
–Database.ANALYTICS.VW_DIM source
CREATE
OR REPLACE VIEW VW_DIM
/*******************************************************************
– View name: VW_DIM
– Layer : Analytics
– Owner :
– Version :
– Created by :
– Created on :
– Reviewed by :
– Purpose :
– Comments :
– JIRA story/incident link :
– Revision history :
Sl No. Date Author Changelog
–
Run this against liquibase validate and it fails.
Expected/Desired Behavior
Validation should have passed
Liquibase Version
4.25.1
Database Vendor & Version
snowflake
Liquibase Integration
CLI
Looks like this issue or a variation of this issue was fixed in earlier version as reported in #3017
Probably fixed for --comment but not for – Comments :
We have a related problem that we used --comments and now it fails when we upgraded to latest version. Once we go in and change all the “comments” to “comment”, hash changes and everything fails. Is there an option to turn this specific validation off or just this section?
Upgrade from “Liquibase Community 4.3.1 by Datical” → Liquibase Version: 4.25.1
I am not having any luck replicating this issue. This changelog does not cause any complaints for me with 4.25.1.
Would it be possible for you to submit a Github issue on this, so it can be more thoroughly investigated?
Thank you,
Wesley
-- liquibase formatted sql
-- changeset somebody:1645123377463-1
CREATE TABLE "proschema"."TABLEWITHCOMMENTS" ("name" VARCHAR(20), "lastname" VARCHAR(20));
COMMENT ON TABLE "proschema"."TABLEWITHCOMMENTS" IS 'THIS IS A COMMENT';
COMMENT ON COLUMN "proschema"."TABLEWITHCOMMENTS"."name" IS 'name commented';
COMMENT ON COLUMN "proschema"."TABLEWITHCOMMENTS"."lastname" IS 'second comment';
--rollback drop table "TABLEWITHCOMMENTS"
-- changeset somebody:viewwithcomments
CREATE OR REPLACE VIEW proschema.viewwithcomments
/*******************************************************************
– View name: VW_DIM
– Layer : Analytics
– Owner :
– Version :
– Created by :
– Created on :
– Reviewed by :
– Purpose :
– Comments :
– JIRA story/incident link :
– Revision history :
Sl No. Date Author Changelog
*******************************************************************/
AS
SELECT a.name,
a.lastname
FROM "TABLEWITHCOMMENTS" a
GROUP BY a.name, a.lastname;
ALTER TABLE proschema.viewwithcomments
OWNER TO proschema;
COMMENT ON VIEW proschema.viewwithcomments
IS 'this comment should be exported';
COMMENT ON COLUMN proschema.viewwithcomments.name
IS 'view name comment';
--rollback drop view viewwithcomments
``
Good Morning,
Thanks for your reply.
Is it possible for you to first run this script in 4.3.5 and then try to upgrade with 4.25.1.
I did not test with 4.25.1 directly. We were trying to upgrade.
I will do some testing with 4.25.1 but in the mean time could you please first run with 4.3.5 and then upgrade