Closed yvesf closed 6 years ago
I have same problem. Does anybody solved it?
@dvsidamore I'll try to fix in near future (probably, on weekend). Thanks for reminding.
The root cause: DBMS_METADATA.GET_DEPENDENT_DDL
return CREATE (UNIQUE|BITMAP)? INDEX
statements sorted by creation date.
I decided to parse DBMS_METADATA.GET_DEPENDENT_DDL
on separateCREATE (UNIQUE|BITMAP)? INDEX
statements and sort these alphanumerically in DDLFormatter
class.
So order for 3 indexes UNIQUE INDEX a
, INDEX b
, BITMAP INDEX c
will be:
CREATE BITMAP INDEX c...
CREATE INDEX b ..
CREATE UNIQUE INDEX a..
Fixed in PR #53
New parameter of DDLFormatter sortCreateIndexStatements
with default value true
added.
After implementing this, I found, that possibly it should be implemented in other way as proposed in https://github.com/qwazer/scheme2ddl/issues/20#issuecomment-83579410
thanks a lot!
Between two exports the ordering of the index statements on a table can vary. This creates annoying diffs if you use git on these files. I think it would be beneficial to explicitly sort the the dependent objects by name or so.