[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2263) hbm2ddl=update with mysql5 & innodb: should update foreign key definition
    Andres Gonzalez (JIRA) 
    noreply at atlassian.com
       
    Fri Nov 24 05:47:04 EST 2006
    
    
  
hbm2ddl=update with mysql5 & innodb: should update foreign key definition
-------------------------------------------------------------------------
         Key: HHH-2263
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2263
     Project: Hibernate3
        Type: Improvement
    Versions: 3.2.0.cr4    
 Environment: Hibernate 3.2.0.cr4
mysql-standard-5.0.27 InnoDB
    Reporter: Andres Gonzalez
If i have this:
        <set name="actividadesSector" inverse="true" cascade="all">
            <key column="id_sector"/>
            <one-to-many class="ActividadSector"/>
        </set>
, execute hbm2ddl and then i change the mapping to:
        <set name="actividadesSector" inverse="true" cascade="all">
            <key column="id_sector" on-delete="cascade"/>
            <one-to-many class="ActividadSector"/>
        </set>
and execute again with hbm2ddl=auto it does nothing and it should:
ALTER TABLE ActividadSector DROP FOREIGN KEY FKBC9......;
ALTER TABLE ActividadSector ADD CONSTRAINT FKBC9D49E394F112A0 FOREIGN KEY (`id_sector`) REFERENCES Sector (id) ON DELETE CASCADE;
(i did it manually, it works)
-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira
    
    
More information about the hibernate-issues
mailing list