liquibase-core/src/main/java/liquibase/structure/core/Index.java
@Override
    public int compareTo(Object other) {
        Index o = (Index) other;
        int returnValue = 0;

        if ((this.getRelation() != null) && (o.getRelation() != null)) {
            returnValue = this.getRelation().compareTo(o.getRelation());
            if ((returnValue == 0) && (this.getRelation().getSchema() != null) && (o.getRelation().getSchema() != null)) {
                returnValue = StringUtil.trimToEmpty(this.getRelation().getSchema().getName()).compareToIgnoreCase(StringUtil.trimToEmpty(o.getRelation().getSchema().getName()));
            }
        }

        if (returnValue == 0) {
            String thisName = StringUtil.trimToEmpty(this.getName());
            String oName = StringUtil.trimToEmpty(o.getName());
            returnValue = thisName.compareTo(oName);
        }

        //We should not have two indexes that have the same name and tablename
        /*if (returnValue == 0) {
        	returnValue = this.getColumnName().compareTo(o.getColumnName());
        }*/


        return returnValue;
    }
@Override
    public int compareTo(Object other) {
        Index o = (Index) other;
        int returnValue = 0;

        if ((this.getRelation() != null) && (o.getRelation() != null)) {
            returnValue = this.getRelation().compareTo(o.getRelation());
            if ((returnValue == 0) && (this.getRelation().getSchema() != null) && (o.getRelation().getSchema() != null)) {
                returnValue = StringUtil.trimToEmpty(this.getRelation().getSchema().getName()).compareToIgnoreCase(StringUtil.trimToEmpty(o.getRelation().getSchema().getName()));
            }
        }

        if (returnValue == 0) {
            String thisName = StringUtil.trimToEmpty(this.getName());
            String oName = StringUtil.trimToEmpty(o.getName());
            returnValue = thisName.compareTo(oName);
        }

        //We should not have two indexes that have the same name and tablename
        /*if (returnValue == 0) {
        	returnValue = this.getColumnName().compareTo(o.getColumnName());
        }*/


        return returnValue;
    }
@ Override public int compareTo ( Object other ) { Index o = ( Index ) other ; int returnValue = 0 ; if ( ( this . getRelation ( ) != null ) && ( o . getRelation ( ) != null ) ) { returnValue = this . getRelation ( ) . compareTo ( o . getRelation ( ) ) ; if ( ( returnValue == 0 ) && ( this . getRelation ( ) . getSchema ( ) != null ) && ( o . getRelation ( ) . getSchema ( ) != null ) ) { returnValue = StringUtil . trimToEmpty ( this . getRelation ( ) . getSchema ( ) . getName ( ) ) . compareToIgnoreCase ( StringUtil . trimToEmpty ( o . getRelation ( ) . getSchema ( ) . getName ( ) ) ) ; } } if ( returnValue == 0 ) { String thisName = StringUtil . trimToEmpty ( this . getName ( ) ) ; String oName = StringUtil . trimToEmpty ( o . getName ( ) ) ; returnValue = thisName . compareTo ( oName ) ; } //We should not have two indexes that have the same name and tablename /*if (returnValue == 0) {
        	returnValue = this.getColumnName().compareTo(o.getColumnName());
        }*/ return returnValue ; }
}
}