Project

General

Profile

Revision 3d88a9ce

ID3d88a9ce55cd9588aa914eeb9ae826ae488fed55
Parent 65df4525
Child 2971012a

Added by Andreas Müller about 2 months ago

fix #7683 fix ExternalLink_AUD.uuid allows null and fix TableCreator for future

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/TableCreator.java
216 216
			}
217 217
			//CdmBase
218 218
			if (includeCdmBaseAttributes){
219
					updateQuery += " id integer NOT NULL,"
219
					String uuidNull = isAuditing? "": "NOT NULL";
220
			        updateQuery += " id integer NOT NULL,"
220 221
						+ " created " + ColumnAdder.getDatabaseColumnType(datasource, "datetime") + ", "
221
						+ " uuid varchar(36) NOT NULL,"
222
						+ " uuid varchar(36) "+uuidNull+","
222 223
						+ (excludeVersionableAttributes? "" : " updated " + ColumnAdder.getDatabaseColumnType(datasource, "datetime") + ", ")
223 224
						+ " createdby_id integer,"
224 225
						+ (excludeVersionableAttributes ? "" : " updatedby_id integer, ");
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v50_51/SchemaUpdater_50_55.java
16 16
import org.apache.log4j.Logger;
17 17

  
18 18
import eu.etaxonomy.cdm.database.update.ColumnAdder;
19
import eu.etaxonomy.cdm.database.update.ColumnNameChanger;
20 19
import eu.etaxonomy.cdm.database.update.ColumnRemover;
20
import eu.etaxonomy.cdm.database.update.ColumnTypeChanger;
21 21
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
22 22
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
23 23
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
......
99 99
        String columnName = "value";
100 100
        tableName = "CdmPreference";
101 101
        // TODO check non MySQL and with existing data (probably does not exist)
102
        step = ColumnNameChanger.NewClobInstance(stepName, tableName,
103
                columnName, columnName, INCLUDE_AUDIT);
102
        step = ColumnTypeChanger.NewClobInstance(stepName, tableName,
103
                columnName, INCLUDE_AUDIT);
104 104
        stepList.add(step);
105 105

  
106 106
        //7857 update name realtionships
107 107
        updateNameRelationships(stepList);
108 108

  
109
        //#7683 allow null for ExternalLink_AUD.uuid
110
        stepName = "Allow null for ExternalLink_AUD.uuid ";
111
        columnName = "uuid";
112
        tableName = "ExternalLink_AUD";
113
        // TODO check non MySQL and with existing data (probably does not exist)
114
        step = ColumnTypeChanger.NewStringSizeInstance(stepName, tableName, columnName, 36, !INCLUDE_AUDIT);
115
        stepList.add(step);
116

  
117

  
109 118
        return stepList;
110 119

  
111 120
	}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)