Discrepancies in null columns between hibernate and upgrade scripts (profile2)

Description

2.7.x (auto-generated)
profile_images_external_t.URL_MAIN not null
profile_images_t.RESOURCE_MAIN not null
profile_images_t.RESOURCE_THUMB not null

2.7.1 -> 2.7.x (converted)
profile_images_external_t.URL_MAIN null
profile_images_t.RESOURCE_MAIN null
profile_images_t.RESOURCE_THUMB null

2.7.2 conversion script (current)

/* change row size of image URI columns */
alter table PROFILE_IMAGES_T modify RESOURCE_MAIN text;
alter table PROFILE_IMAGES_T modify RESOURCE_THUMB text;

alter table PROFILE_IMAGES_EXTERNAL_T modify URL_MAIN text;
alter table PROFILE_IMAGES_EXTERNAL_T modify URL_THUMB text;

Modify to

/* change row size of image URI columns */
alter table PROFILE_IMAGES_T modify RESOURCE_MAIN text not null;
alter table PROFILE_IMAGES_T modify RESOURCE_THUMB text not null;

alter table PROFILE_IMAGES_EXTERNAL_T modify URL_MAIN text not null;
alter table PROFILE_IMAGES_EXTERNAL_T modify URL_THUMB text;

Activity

Show:

Anthony Whyte August 15, 2011 at 8:21 PM

Trunk r96398 merged to 2.8.x, r97024.

Anthony Whyte August 15, 2011 at 6:27 PM
Edited

2.7.x r97018, 2.7.2 r97019. The 2.7.1->2.7.2 conversion scripts were also added to 2.8.x (r97022)/2.8.1 (r97021). Trunk r96396 is included in these scripts as well.

Matthew Jones August 4, 2011 at 12:07 PM

I reopened this to fix the oracle conversion so that there are 2 separate alter statement. It doesn't seem like the "not null" clause is needed and causes a failure of the entire statement in oracle.

Matthew Jones July 29, 2011 at 3:14 PM

On Oracle in 2.7.1, the column is NOT NULL already, and trying to modify it to NOT NULL in a conversion causes "FAILURE: ORA-01442: column to be modified to NOT NULL is already NOT NULL", () which also prevents the size from being changed. Probably should either have 2 alters so the size change can succeed at least or remove the NOT NULL from Oracle.

Dunno why there was a null in mysql? Weird stuff, hibernate!

Steve Swinsburg July 26, 2011 at 10:24 PM

2.7.x r95704

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Conversion Script Required

Yes
Created July 26, 2011 at 10:09 PM
Updated November 26, 2012 at 7:30 AM
Resolved September 10, 2011 at 12:19 PM