You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL Anywhere: generateChangeLog fails when column's default value is an expression (e. g. Unexpected error running Liquibase: Unknown boolean value: if "mycol" is null then 0 else 1 endif)
#4429
Closed
2 tasks done
mkarg opened this issue
Jun 23, 2023
· 1 comment
· Fixed by #4507
In SQL Anywhere, columns can have default values which are no literals but expressions, for example if "mycol" is null then 0 else 1 endif. Apparently Liquibase cannot support expressions but only literals, as the error message says:
Unexpected error running Liquibase: Unknown boolean value: if "mycol" is null then 0 else 1 endif
This is a showstopper for generating change log from existing SQL Anywhere database.
Steps To Reproduce
CREATETABLEA (
c1 int,
c2 bitNULL COMPUTE (if "c1" is null then 0 else 1 endif)
)
…'s default value is an expression (e. g. Unexpected error running Liquibase: Unknown boolean value: if "mycol" is null then 0 else 1 endif) (#4507)
* Fixed: SQL Anywhere incorrectly reports importedKeyInitiallyImmediate where it needs to report importedKeyNotDeferrable
* Fixed: SQL Anywhere can defer foreign key constraints, but uses a different SQL syntax to define it.
* Adding support for SQL Anywhere generated columns.
* Fixed: Unknown boolean value: if mycol is null then 0 else 1 endif
---------
Co-authored-by: filipe <flautert@liquibase.org>
Co-authored-by: rberezen <ruslan.berezenskyi@gmail.com>
Search first
Description
In SQL Anywhere, columns can have default values which are no literals but expressions, for example
if "mycol" is null then 0 else 1 endif
. Apparently Liquibase cannot support expressions but only literals, as the error message says:This is a showstopper for generating change log from existing SQL Anywhere database.
Steps To Reproduce
Expected/Desired Behavior
Liquibase successfully creates change log including the column default value expression
if "mycol" is null then 0 else 1 endif"
.Liquibase Version
master
Database Vendor & Version
SAP SQL Anywhere 17.0.11
Liquibase Integration
N/A
Liquibase Extensions
N/A
OS and/or Infrastructure Type/Provider
Windows 10 Pro (German)
Additional Context
N/A
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: