에서 테이블을 만들 수 없습니다. 도메인 클래스에서 원하는 스키마를 지정했습니다 (아래 참조). 문제점은 테이블이 공용 스키마에서만 작성되고 적절한 스키마에서 작성되지 않는다는 것입니다.Grails는 : openlearning, 데이터와 contrib : 나는</strong> 또한 세 가지 스키마와 <strong>PostgreSQL 데이터베이스와 <strong>Grails를 3.3.0</strong>를 사용하려면 적절한 스키마
올바른 스키마에 테이블을 만들려면 어떻게해야합니까?
참고 : 테이블은 모두 공용 스키마에 만들어집니다. 다른 스키마는 만들어 지지만 비어 있습니다. 테이블을 포함하지 않습니다.
질문 도메인 클래스 :이
package fr.dr.openlearning
class Question {
static mapping = {
id generator: 'increment',params:[sequence:'incr']
schema : "data"
}
application.yml :이 application.yml 파일에서
dataSource:
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/openlearning
username: postgres
password: XXX
pooled: true
jmxExport: true
environments:
development:
dataSource:
dbCreate: create-drop
dataSources:
data:
dbCreate: create-drop
contrib:
dbCreate: create-drop
답변 덕분에 동일하지만. 테 이블은 공용 스키마에서만 작성됩니다. – drieu