我在应用程序中添加了postrgresql,但是在Travis中使用它时遇到了一些麻烦。我收到以下错误消息:
org.postgresql.util.PSQLException: FATAL: database "bikeRental" does not exist
我在travis.yml中创建了数据库:
language: java
jdk:
- oraclejdk8
services:
- postgresql
install:
- echo "Skip install step"
before_script:
- psql -c 'create database bikeRental;' -U postgres
- cat .config/travis.application.properties > src/main/resources/application.properties
script:
- mvn clean package
cache:
directories:
- $HOME/.m2
notifications:
email: false
并使用以下属性文件进行连接:
server.port=8081
spring.thymeleaf.cache=false
spring.thymeleaf.enabled=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.application.name=csharp
spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:5432/bikeRental
spring.datasource.username=postgres
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true