[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6384) hibernate.hbm2ddl.auto=create does not drop tables

Gail Badner (JIRA) noreply at atlassian.com
Fri Aug 19 20:41:05 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43304#comment-43304 ] 

Gail Badner commented on HHH-6384:
----------------------------------

Lukasz, sorry, didn't know you were working on it until I was about to commit my fix.

I see that your pull request makes changes to how SessionFactoryImpl uses SchemaExport.

I've created a pull request that restores the 3.6 behavior, where SchemaExport.create() executes the drop script before executing the create script:
https://github.com/hibernate/hibernate-core/pull/156

Steve, you decide which is preferred.

Gail

> hibernate.hbm2ddl.auto=create does not drop tables
> --------------------------------------------------
>
>                 Key: HHH-6384
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6384
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.Beta2
>            Reporter: Alexandre Gattiker
>            Assignee: Gail Badner
>             Fix For: 4.0.0.next
>
>         Attachments: hibtest.zip
>
>
> Setting <property name="hibernate.hbm2ddl.auto" value="create" /> does not drop tables previous to creating them. That was the behavior up to at least 3.6.0 and was extremely useful for test cases.
> To reproduce, run attached test case twice.
> 08:27:44,503 [main] DEBUG SqlStatementLogger - create table Customer (id int8 not null, primary key (id))
> 08:27:44,504 [main] ERROR SchemaExport - HHH00389:Unsuccessful: create table Customer (id int8 not null, primary key (id))
> 08:27:44,504 [main] ERROR SchemaExport - ERROR: relation "customer" already exists
> 08:27:44,505 [main] INFO  SchemaExport - HHH00230:Schema export complete

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list