Hello there,
I’m currently experiencing an error when applying a SQL changelog with opening and closing braces on postgreSQL
Do you know how I can use those curly braces in my SQL changelogs ?
here is my sample changelog :
-- liquibase formatted sql
-- changeset john.doe:4_3_2_50_migrate_workspace_document_indexing_settings_20221021 splitStatements:false
BEGIN TRANSACTION;
SET search_path TO ${agathaMetadataSchema};
UPDATE workspace SET settings = jsonb_set(settings::jsonb,
'{DocumentIndexingSettings,OcrEnabled}',
'true',
true)
WHERE (settings#>'{DocumentIndexingEnabled}')::jsonb <> 'null'
AND (settings#>'{DocumentIndexingEnabled}')::jsonb = 'true'
AND (settings#>'{DocumentIndexingSettings,Languages}')::jsonb <> 'null'
AND jsonb_array_length((settings#>'{DocumentIndexingSettings,Languages}')::jsonb) > 0;
COMMIT;
and here is the error when performing the liquibase update command :
[2022-11-18 09:56:27] FINE [liquibase.executor] Executing with the 'jdbc' executor
[2022-11-18 09:56:27] SEVERE [liquibase.integration] Unterminated string literal started at position 116 in SQL BEGIN TRANSACTION;
SET search_path TO test;
UPDATE workspace SET settings = jsonb_set(settings::jsonb,
'{DocumentIndexingSettings,OcrEnabled. Expected char [Failed SQL: (0) BEGIN TRANSACTION;
SET search_path TO test;
UPDATE workspace SET settings = jsonb_set(settings::jsonb,
'{DocumentIndexingSettings,OcrEnabled]
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Migration failed for change set changelogs/4_3_2/test/50_migrate_workspace_document_indexing_settings_20221021.sql::4_3_2_50_migrate_workspace_document_indexing_settings_20221021::john.doe:
Reason: liquibase.exception.DatabaseException: Unterminated string literal started at position 116 in SQL BEGIN TRANSACTION;```
Thanks !