1

I'm using Postgres and also the Datasources plugin.

Rails has a property called schema_search_path. Is there an equivalent in Grails?

I have two schemas, hk and public in the database.

Where can I specify a search path for the schema or a specific schema name?

I was able to make this work using the syntax like the following on the individual class.

static mapping = { table name:'he_stats_item_summary_keywords', schema:'he' }

However, it would still be nice to know if there was an equivalent to the schema_search_path on the datasource.

1 Answer 1

3

Possible solution found at:

PostgreSQL Default Schema in DataSource
Add support the hibernate.default_schema property to the _DataSource.groovy file

development {
dataSource {
dbCreate = "update"
url = "jdbc:postgresql://localhost:5432/deploy"
hibernate.default_schema = "turnkey_dev"
dialect = org.hibernate.dialect.PostgreSQLDialect
}
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.