Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE (UNIQUE) INDEX statement in table files are not sorted #44

Closed
yvesf opened this issue Jun 23, 2016 · 6 comments
Closed

CREATE (UNIQUE) INDEX statement in table files are not sorted #44

yvesf opened this issue Jun 23, 2016 · 6 comments
Assignees

Comments

@yvesf
Copy link

yvesf commented Jun 23, 2016

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.

@dvsidamore
Copy link

I have same problem. Does anybody solved it?

image

@qwazer
Copy link
Owner

qwazer commented Oct 31, 2018

@dvsidamore I'll try to fix in near future (probably, on weekend). Thanks for reminding.

@qwazer qwazer self-assigned this Oct 31, 2018
@qwazer
Copy link
Owner

qwazer commented Nov 4, 2018

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.

@qwazer
Copy link
Owner

qwazer commented Nov 4, 2018

fixed in v2.4.2

@qwazer qwazer closed this as completed Nov 4, 2018
@qwazer
Copy link
Owner

qwazer commented Nov 4, 2018

After implementing this, I found, that possibly it should be implemented in other way as proposed in #20 (comment)

@dvsidamore
Copy link

thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants