Grails PostgreSQL не создает таблицы
Я использую Grails 3 со следующей зависимостью в build.gradle
runtime group: 'org.postgresql', name: 'postgresql', version: '9.4.1209'
мой application.yml имеет следующий конфиг
hibernate:
cache:
queries: false
use_second_level_cache: true
use_query_cache: false
region.factory_class: 'org.hibernate.cache.ehcache.EhCacheRegionFactory'
dataSource:
pooled: true
jmxExport: true
driverClassName: org.postgresql.Driver
username: postgres
password: test
environments:
development:
dataSource:
dbCreate: create-drop
url: jdbc:postgresql://localhost:5432/devdb
test:
dataSource:
dbCreate: update
url: jdbc:postgresql://localhost:5432/testdb
production:
dataSource:
dbCreate: update
url: jdbc:postgresql://localhost:5432/proddb
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
---
Мой класс домена выглядит следующим образом
import grails.rest.Resource
@Resource(uri='/issue')
class Issue {
String issueKey
static constraints = {
}
}
Когда сервер запускается, таблица не создается, и он выдает следующее исключение при чтении данных на экранах списка.
Caused by: org.postgresql.util.PSQLException: ERROR: relation "issue" does not exist
Position: 13
Тот же код прекрасно работает с H2