Bug 117294 - forms_widget_label : wrong setting in sql upgrade script (from 5.2 to 6)
forms_widget_label : wrong setting in sql upgrade script (from 5.2 to 6)
Status: NEW
Product: Red Hat Web Application Framework
Classification: Retired
Component: persistence (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
:
Depends On:
Blocks: 108447
  Show dependency treegraph
 
Reported: 2004-03-02 12:13 EST by durnez
Modified: 2008-05-01 11:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description durnez 2004-03-02 12:13:32 EST
Description of problem:
Whenever, in simpleSurvey admin ui, i want to edit a new control
("Edit controls" link), i encounter the following exception :

com.arsdigita.persistence.PersistenceException:  (root cause:
com.redhat.persistence.engine.rdbms.RDBMSEngine$2: ORA-02291:
integrity constraint (C4FR_TEST2.FORMS_WGT_LABEL_LABEL_ID_FK) violated
- parent key not found)        at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:137)
       at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:109)
       at
com.arsdigita.persistence.DataObjectImpl.save(DataObjectImpl.java:413)
[...]

According to file
sql/core/default/formbuilder/table-forms_widget_label.sql (see content
below) :
create table forms_widget_label (    
     label_id integer        constraint forms_wgt_label_label_id_fk  
      
        references bebop_components (component_id)        
        constraint forms_wgt_label_label_id_pk primary key,    
     widget_id integer
        constraint         forms_wgt_label_widget_id_fk
        references bebop_widgets (widget_id) on delete cascade
);

label_id must point to an existing bebop_components item.


but the upgrade script
sql/core/oracle-se/upgrade/5.2.1-6.0.0/auto-upgrade.sql is wrong at
lines 235-237 :
alter table FORMS_WIDGET_LABEL drop constraint
FORMS_WGT_LABEL_LABEL_ID_FK;
alter table FORMS_WIDGET_LABEL add constraint
FORMS_WGT_LABEL_LABEL_ID_FK    foreign key(LABEL_ID) references
BEBOP_WIDGETS(WIDGET_ID);

those lines must be replaced by :

alter table FORMS_WIDGET_LABEL drop constraint
FORMS_WGT_LABEL_LABEL_ID_FK;
alter table FORMS_WIDGET_LABEL add constraint
FORMS_WGT_LABEL_LABEL_ID_FKforeign key(LABEL_ID) references
BEBOP_COMPONENTS(COMPONENT_ID);

That way, new controls can be edited in simple survey admin ui.



How reproducible:
always

Note You need to log in before you can comment on or make changes to this bug.