diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties new file mode 100644 index 000000000..eb0401ab7 --- /dev/null +++ b/src/main/resources/application-dev.properties @@ -0,0 +1,9 @@ +# database init, supports postgres too +database=postgres +spring.datasource.url=${POSTGRES_URL:jdbc:postgresql://localhost:5433/petclinic_dev} +spring.datasource.username=${POSTGRES_USER:petclinic} +spring.datasource.password=${POSTGRES_PASS:petclinic} +# SQL is written to be idempotent so this is safe +spring.sql.init.mode=always + +spring.liquibase.contexts=dev diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties new file mode 100644 index 000000000..8f0285f2d --- /dev/null +++ b/src/main/resources/application-prod.properties @@ -0,0 +1,9 @@ +# database init, supports postgres too +database=postgres +spring.datasource.url=${POSTGRES_URL:jdbc:postgresql://localhost:5432/petclinic} +spring.datasource.username=${POSTGRES_USER:petclinic} +spring.datasource.password=${POSTGRES_PASS:petclinic} +# SQL is written to be idempotent so this is safe +spring.sql.init.mode=always + +spring.liquibase.contexts=prod diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 6ed985654..ec2337454 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,11 @@ # database init, supports mysql too -database=h2 -spring.sql.init.schema-locations=classpath*:db/${database}/schema.sql -spring.sql.init.data-locations=classpath*:db/${database}/data.sql +database=dev +spring.profiles.active=${database} +# spring.sql.init.schema-locations=classpath*:db/${database}/schema.sql +# spring.sql.init.data-locations=classpath*:db/${database}/data.sql + +spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.xml + # Web spring.thymeleaf.mode=HTML