Liquibase: The "databasechangeloglock" relation already exists using the Grails plugin and a non-standard schema

I am using grails 2.0.3, plugin 1.1 for database (Liquibase) and postgres 9.1.

I see that I think this is the same problem described by these other users, but with wrinkles:

Wrinkles are as follows:

  • I am using grails and a database migration plugin.
  • The production database does not use the default schema.
  • I have to use automatic database migration at startup (grails.plugin.databasemigration.updateOnStart = true), because no developer has access to the actual production databases.

My understanding of the problem is that Liquibase checks the default schema for the existence of its service tables, and then tries to create the tables in the right place, the default schema. But, of course, they already exist after the first execution. This seems to be a workaround by specifying a command line parameter, but I do not have this option because of the need to start automating within the grails as-deployed application.

Is there a way to make a database migration plugin do what I need? Telling database administrators how to organize schemas in different ways is not an option.

, .

+5
1

schemaName.

<tableExists schemaName="myschema" tableName="..."/>
<createTable schemaName="myschema" tableName="..."/>

:

<databaseChangeLog ..>
  <property name="schema.name" value="myschema"/>
  ....
  <changeset ...>
    <createTable schemaName="${schema.name]" tableName="..."/>
  </changeset>
</databaseChangeLog>

Liquibase defaultSchemaName, (Grails) :

grails.plugin.databasemigration.updateOnStartDefaultSchema
+3

All Articles