if (objectBreak.getObject() instanceof DaColumn) { DaColumn col = (DaColumn) objectBreak.getObject(); this.printSql(ps, "addCol" + col.getName(), this.getAddColumnString(col)); } else if (objectBreak.getObject() instanceof DaTable) { LOG.debug("Ignoring this break [{}], relying on AquaReveng to do this", objectBreak.getObject()); DaIndex index = (DaIndex) objectBreak.getObject(); if (table.getPrimaryKey() == null || !DaIndex.TO_COLUMNS.valueOf(table.getPrimaryKey()).equals(DaIndex.TO_COLUMNS.valueOf(index))) { this.printSql(ps, "addIndex" + index.getName(), this.getIndexSql(index)); } else { System.out.println("Warning - a case where one side has a unique index that is represented as a pk"); this.printSql(ps, "unhandled", "Unhandled Object Break: " + objectBreak.getObject().getClass() + ":" + objectBreak); DaColumn col = (DaColumn) fieldBreak.getLeft(); if (fieldBreak.getFieldName().equals("nullable")) { this.printSql(ps , "modifyNullable_" + col.getName() , "-- if the difference is in the nullable value, then set it to nullable for compatibility across instances\n" + "ALTER TABLE " + col.getParent().getName() + " MODIFY " + col.getName() + " NULL"); } else if (fieldBreak.getFieldName().equals("width")) { this.printSql(ps , "modifyWidth_" + col.getName() , "-- if the difference is in the width value, then set it to the max value\n" + "ALTER TABLE " + col.getParent().getName() + " MODIFY " + col.getName() + " " + col.getColumnDataType()); } else if (fieldBreak.getFieldName().equals("default")) { this.printSql(ps , "modifyDefault_" + col.getName() , "-- if the difference is in the default value, then change it\n"
if (objectBreak.getObject() instanceof DaColumn) { DaColumn col = (DaColumn) objectBreak.getObject(); this.printSql(ps, "addCol" + col.getName(), this.getAddColumnString(col)); } else if (objectBreak.getObject() instanceof DaTable) { LOG.debug("Ignoring this break [{}], relying on AquaReveng to do this", objectBreak.getObject()); DaIndex index = (DaIndex) objectBreak.getObject(); if (table.getPrimaryKey() == null || !DaIndex.TO_COLUMNS.valueOf(table.getPrimaryKey()).equals(DaIndex.TO_COLUMNS.valueOf(index))) { this.printSql(ps, "addIndex" + index.getName(), this.getIndexSql(index)); } else { System.out.println("Warning - a case where one side has a unique index that is represented as a pk"); this.printSql(ps, "unhandled", "Unhandled Object Break: " + objectBreak.getObject().getClass() + ":" + objectBreak); DaColumn col = (DaColumn) fieldBreak.getLeft(); if (fieldBreak.getFieldName().equals("nullable")) { this.printSql(ps , "modifyNullable_" + col.getName() , "-- if the difference is in the nullable value, then set it to nullable for compatibility across instances\n" + "ALTER TABLE " + col.getParent().getName() + " MODIFY " + col.getName() + " NULL"); } else if (fieldBreak.getFieldName().equals("width")) { this.printSql(ps , "modifyWidth_" + col.getName() , "-- if the difference is in the width value, then set it to the max value\n" + "ALTER TABLE " + col.getParent().getName() + " MODIFY " + col.getName() + " " + col.getColumnDataType()); } else if (fieldBreak.getFieldName().equals("default")) { this.printSql(ps , "modifyDefault_" + col.getName() , "-- if the difference is in the default value, then change it\n"