I am using grails 2.0.3, database-migration (liquibase) plugin 1.1, and postgres 9.1.
I am seeing what I think is the same issue described by these other users, but with wrinkles:
The wrinkles are that:
My understanding of the issue is that liquibase is checking the default schema for the existence of its maintenance tables, and then attempts to create the tables in the right place, the non-default schema. But of course they already exist after the first execution. There seems to be a workaround by specifying a command-line option, but I don't have that option because of the requirement to run automated, within the grails app as-deployed.
Is there a way to make the database-migration plugin do what I need? Telling the DBAs to organize the schemas differently is not an option.
Thanks in advance, Ray A. Conner
with me it was the missing owner rights. That way the table could not be found by the logged in user, but it could also not be created, since it was there.
My fix was to change the owner to the correct person.
Preconditions and refactoring commands take an attribute schemaName.
<tableExists schemaName="myschema" tableName="..."/>
<createTable schemaName="myschema" tableName="..."/>
You can also parametrize it:
<databaseChangeLog ..>
<property name="schema.name" value="myschema"/>
....
<changeset ...>
<createTable schemaName="${schema.name]" tableName="..."/>
</changeset>
</databaseChangeLog>
For Liquibase itself, you can set defaultSchemaName, in your case (Grails) this should be:
grails.plugin.databasemigration.updateOnStartDefaultSchema
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With