title: Liquibase: Does not honor schema name for H2, but MySQL is fine
body: <ul>
  <li>I am using <code>maven cargo</code> to deploy my <code>Spring</code> application.</li>
  <li>I am trying to run this against <code>MySQL</code> and <code>H2</code> embedded database.<br>
  The configuration for <code>H2</code> looks like  </li>
  </ul>
  
  <blockquote>
  <pre><code>@Configuration
  @Profile("development")
  public class H2DatabaseConfig extends JpaCommonConfig {
      @Override
      public DataSource dataSource() {
          // (todo: harit) get rid of hard coding
          System.out.println("This is H2 Database Profile");
          final BasicDataSource dataSource = new BasicDataSource();
          dataSource.setDriverClassName("org.h2.Driver");
          dataSource.setUrl("jdbc:h2:mem:test_common");
          dataSource.setUsername("sa");
          dataSource.setPassword("");
          return dataSource;
      }
  
      @Override
      protected Class&lt;? extends Dialect&gt; getDatabaseDialect() {
          return H2Dialect.class;
      }
  
      @Override
      protected Properties getJpaProperties() {
          final Properties properties = new Properties();
          properties.setProperty(HBM2DDL_AUTO, Hbm2ddlType.CREATE_DROP.toValue());
          properties.setProperty(SHOW_SQL, TRUE.toString());
          properties.setProperty(FORMAT_SQL, TRUE.toString());
          properties.setProperty(USE_SQL_COMMENTS, TRUE.toString());
          properties.setProperty(CONNECTION_CHAR_SET, getHibernateCharSet());
          properties.setProperty(NAMING_STRATEGY, ImprovedNamingStrategy.class.getName());
  
          return properties;
      }
  }
  </code></pre>
  </blockquote>
  
  <p>and for <code>MySQL</code> it looks like  </p>
  
  <pre><code>@Configuration
  @Profile("default")
  public class MySqlDatabaseConfig extends JpaCommonConfig {
      @Override
      public DataSource dataSource() {
          // (todo: harit) remove hardcoding to read from environment variables
          System.out.println("This is MySQL Database Profile");
          final BasicDataSource dataSource = new BasicDataSource();
          dataSource.setDriverClassName("com.mysql.jdbc.Driver");
          dataSource.setUrl("jdbc:mysql://localhost:3306/test_common?createDatabaseIfNotExist=true");
          dataSource.setUsername("root");
          return dataSource;
      }
  
      @Override
      protected Class&lt;? extends Dialect&gt; getDatabaseDialect() {
          return MySQL5InnoDBDialect.class;
      }
  
      @Override
      protected Properties getJpaProperties() {
          final Properties properties = new Properties();
          properties.setProperty(HBM2DDL_AUTO, Hbm2ddlType.UPDATE.toValue());
          properties.setProperty(SHOW_SQL, TRUE.toString());
          properties.setProperty(FORMAT_SQL, TRUE.toString());
          properties.setProperty(USE_SQL_COMMENTS, TRUE.toString());
          properties.setProperty(CONNECTION_CHAR_SET, getHibernateCharSet());
          properties.setProperty(NAMING_STRATEGY, ImprovedNamingStrategy.class.getName());
          return properties;
      }
  }
  </code></pre>
  
  <p>When I run Integration tests using cargo, I see two differences,</p>
  
  <ol>
  <li>When ran against <code>MySQL</code> the schema name is taken care when Liquibase runs, I see <strong>test_common</strong>  </li>
  </ol>
  
  <blockquote>
  <pre><code>INFO 5/26/14 9:18 AM:liquibase: Successfully acquired change log lock
  INFO 5/26/14 9:18 AM:liquibase: Dropping Database Objects in schema: test_common.test_common
  INFO 5/26/14 9:18 AM:liquibase: Creating database history table with name: test_common.DATABASECHANGELOG
  INFO 5/26/14 9:18 AM:liquibase: Successfully released change log lock
  INFO 5/26/14 9:18 AM:liquibase: Successfully acquired change log lock
  INFO 5/26/14 9:18 AM:liquibase: Reading from test_common.DATABASECHANGELOG
  INFO 5/26/14 9:18 AM:liquibase: Reading from test_common.DATABASECHANGELOG
  INFO 5/26/14 9:18 AM:liquibase: Reading from test_common.DATABASECHANGELOG
  INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: Reading from
  </code></pre>
    
    <p>test_common.DATABASECHANGELOG
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: Table network created
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: ChangeSet
    liquibase/2014/1-1.xml::05192014.1525::h2 ran successfully in 8ms
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: Reading from
    test_common.DATABASECHANGELOG
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: Reading from
    test_common.DATABASECHANGELOG
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: ChangeSet
    liquibase/2014/1-2.xml::05192014.1525::h2 ran successfully in 6ms
        INFO 5/26/14 9:18 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: Reading from
    test_common.DATABASECHANGELOG
        INFO 5/26/14 9:18 AM:liquibase: Successfully released change log lock</p>
  </blockquote>
  
  <ol>
  <li>When ran against <code>H2</code>, It applies on <strong>PUBLIC</strong> schema and <strong>not</strong> on <strong>test_common</strong>  </li>
  </ol>
  
  <blockquote>
  <pre><code>INFO 5/26/14 9:45 AM:liquibase: Successfully acquired change log lock
  INFO 5/26/14 9:45 AM:liquibase: Dropping Database Objects in schema: TEST_COMMON.PUBLIC
  INFO 5/26/14 9:45 AM:liquibase: Creating database history table with name: PUBLIC.DATABASECHANGELOG
  INFO 5/26/14 9:45 AM:liquibase: Creating database history table with name: PUBLIC.DATABASECHANGELOG
  INFO 5/26/14 9:45 AM:liquibase: Successfully released change log lock
  INFO 5/26/14 9:45 AM:liquibase: Successfully acquired change log lock
  INFO 5/26/14 9:45 AM:liquibase: Reading from PUBLIC.DATABASECHANGELOG
  INFO 5/26/14 9:45 AM:liquibase: Reading from PUBLIC.DATABASECHANGELOG
  INFO 5/26/14 9:45 AM:liquibase: Reading from PUBLIC.DATABASECHANGELOG
  INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: Reading from
  </code></pre>
    
    <p>PUBLIC.DATABASECHANGELOG
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: Table network created
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: ChangeSet
    liquibase/2014/1-1.xml::05192014.1525::h2 ran successfully in 5ms
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-1.xml::05192014.1525::h2: Reading from
    PUBLIC.DATABASECHANGELOG
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: Reading from
    PUBLIC.DATABASECHANGELOG
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: New row inserted into
    network
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: ChangeSet
    liquibase/2014/1-2.xml::05192014.1525::h2 ran successfully in 5ms
        INFO 5/26/14 9:45 AM:liquibase: liquibase/changelog.xml: liquibase/2014/1-2.xml::05192014.1525::h2: Reading from
    PUBLIC.DATABASECHANGELOG
        INFO 5/26/14 9:45 AM:liquibase: Successfully released change log lock</p>
  </blockquote>
  
  <p>What is going wrong here?</p>