Wrong snapshot generation causes exception during diff snapshot command
Description
Environment
Oracle 11g, java7u21
Attachments
3
Activity
Show:
Nathan Voxland November 23, 2015 at 8:37 PM
Modified the code causing the problem in to just look for when there are columns with ASC or DESC at the end of their names. Otherwise, we include in them in the snapshot correctly.
Nathan Voxland November 19, 2015 at 11:05 PM
It appears to be caused by https://github.com/NSIT/liquibase/commit/dcd70fe13a384907402b2be40368a06f4fbda08a for CORE-419. Researching...
Firstly I generate snapshot using snapshot command. Then I compare it with its copy and get exception Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to liquibase.structure.core.Column
Steps to reproduce:
1. Create database using createDB.sql.
2. Generate snapshot for created database using snapshot command json format.
3. You should get something like snapshot1.json.
4. Create a copy of snapshot1.json to compare it with itself.
5. Compare snapshots using diff command.
6. You'll get exception like in log.txt.
I believe snapshot command processes inlined oracle constraints wrongly as a result we have in json something like this "uniqueConstraint": {
"backingIndex": "liquibase.structure.core.Index#ac3d104",
"columns": [
"liquibase.structure.core.Column#null"]
and this causes failure on parsing during diff command.
After removing all data with liquibase.structure.core.Column#null all works fine.