Project

General

Profile

Revision 2cdc89ce

ID2cdc89ce4b06c61b8b7256e0e6a32a33c5b0bd7c
Parent 6fac03ea
Child ff183e33

Added by Andreas Müller about 1 year ago

Reduce IndexSize for IndexAdder if requried

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/IndexAdder.java
67 67
	        CaseType caseType, SchemaUpdateResult result) {
68 68
		try {
69 69
		    String constraintName = StringUtils.uncapitalize(tableName) + columnName + "Index";
70
			String updateQuery = getCreateQuery(datasource, caseType, tableName, constraintName, columnName);
70
			if(constraintName.length()>64){
71
			    //MySQL has problems with index names > 64,  https://stackoverflow.com/questions/28615903/error-1059-identifier-name-too-long-on-foreign-key-constraints-from-existing-ta
72
			    constraintName = constraintName.replace("Base", "");
73
			}
74
		    String updateQuery = getCreateQuery(datasource, caseType, tableName, constraintName, columnName);
71 75
			datasource.executeUpdate(updateQuery);
72 76
			return;
73 77
		} catch (Exception e) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)