Grails
  1. Grails
  2. GRAILS-2989

Mixup in precedence of dbCreate in conf/DataSource.groovy

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OS X 10.5.2, java 1.5.0_13, MySQL 5.0.45, mysql-connector-java-5.0.7-bin.jar

      Description

      The actual value of dbCreate passed to Hibernate should always be the most-specific one from DataSource.groovy (if I understood the purpose of environments correctly).

      Sometimes the generic value (from the top-level dataSource block) takes precedence.

      Here is a summary of my tests, DataSource.groovy files and debug output to be attached to issue later (I manually drop the tables between each run):

      VALUE IN TOP-LEVEL BLOCK VALUE IN development ENVIRONMENT BLOCK OUTCOME
      create-drop undef tables are dropped and re-created
      create-drop update tables are updated, created when non-existent
      undef create-drop tables are dropped and re-created
      update create-drop tables are dropped and re-created
      create undef tables are dropped and re-created
      create update tables are dropped and re-created
      undef create tables are dropped and re-created
      update create tables are dropped and re-created
      undef update hbm2ddl not run
      update undef tables are updated, created when non-existent

        Activity

        Hide
        Marc Paquette added a comment -

        Zip Archive.zip contains 20 files : 10 versions of DataSource.groovy and 10 log files of grails startup using the corresponding DataSource.groovy config.

        Show
        Marc Paquette added a comment - Zip Archive.zip contains 20 files : 10 versions of DataSource.groovy and 10 log files of grails startup using the corresponding DataSource.groovy config.
        Hide
        Marc Paquette added a comment -

        I made some errors while transcribing tests outcomes, here is an updated summary table:

        VALUE IN TOP-LEVEL BLOCK VALUE IN development ENVIRONMENT BLOCK OUTCOME
        create-drop undef tables are updated, created when non-existent
        create-drop update tables are updated, created when non-existent
        undef create-drop tables are updated, created when non-existent
        update create-drop tables are updated, created when non-existent
        create undef tables are dropped and re-created
        create update tables are dropped and re-created
        undef create tables are dropped and re-created
        update create tables are dropped and re-created
        undef update hbm2ddl not run
        update undef tables are updated, created when non-existent
        Show
        Marc Paquette added a comment - I made some errors while transcribing tests outcomes, here is an updated summary table: VALUE IN TOP-LEVEL BLOCK VALUE IN development ENVIRONMENT BLOCK OUTCOME create-drop undef tables are updated, created when non-existent create-drop update tables are updated, created when non-existent undef create-drop tables are updated, created when non-existent update create-drop tables are updated, created when non-existent create undef tables are dropped and re-created create update tables are dropped and re-created undef create tables are dropped and re-created update create tables are dropped and re-created undef update hbm2ddl not run update undef tables are updated, created when non-existent

          People

          • Assignee:
            Unassigned
            Reporter:
            Marc Paquette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development