Bonjour à tous, j’ai un projet de test, sans réel business logic mais juste pour tester certains concepts.
La première partie du projet utilise une List comme db statique et avec Postman j’arrive à réaliser mes actions de CRUD mais je veux passer à la seconde phase c’est de brancher une bd posgresql j’ai donc dans le repertoire
Project-config/local-env un fichier docker-compose.yml que je lance via la commande
Docker-compose docker-compose.yml up qui me crée la bd demo à laquelle je me connecte via:
psql -p 5432 -h 127.0.0.1 -d demo -U demo -W
et le mot de passe est: demo
Lorsque je vais dans ma main class et que je la run, j’ai un log de warning qui me dit qu’il y’a aucun script de migration lancé, pourtant il est bien dans resources/db/migration et mon fichier
application.yml défini bien le chemin du fichier
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| . ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.1)
2021-01-01 09:54:47.323 INFO 41649 --- [ main] c.w.r.demo.ReactorCrudDemoApplication : Starting ReactorCrudDemoApplication using Java 11.0.2 on Admins-MacBook-Pro.local with PID 41649 (/Users/pwasnyo/perso-workspace/demo/target/classes started by pwasnyo in /Users/pwasnyo/perso-workspace/demo)
2021-01-01 09:54:47.328 INFO 41649 --- [ main] c.w.r.demo.ReactorCrudDemoApplication : No active profile set, falling back to default profiles: default
2021-01-01 09:54:47.924 INFO 41649 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-01-01 09:54:47.937 INFO 41649 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 JPA repository interfaces.
2021-01-01 09:54:48.378 INFO 41649 --- [ main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 6.5.7 by Redgate
2021-01-01 09:54:48.385 INFO 41649 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-01-01 09:54:48.472 INFO 41649 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-01-01 09:54:48.493 INFO 41649 --- [ main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:postgresql://localhost:5432/demo (PostgreSQL 11.7)
2021-01-01 09:54:48.546 INFO 41649 --- [ main] o.f.core.internal.command.DbValidate : Successfully validated 0 migrations (execution time 00:00.019s)
2021-01-01 09:54:48.546 WARN 41649 --- [ main] o.f.core.internal.command.DbValidate : No migrations found. Are your locations set up correctly?
2021-01-01 09:54:48.561 INFO 41649 --- [ main] o.f.core.internal.command.DbMigrate : Current version of schema "demo": << Empty Schema >>
2021-01-01 09:54:48.563 INFO 41649 --- [ main] o.f.core.internal.command.DbMigrate : Schema "demo" is up to date. No migration necessary.
2021-01-01 09:54:48.702 INFO 41649 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-01-01 09:54:48.756 INFO 41649 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.25.Final
2021-01-01 09:54:48.907 INFO 41649 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-01-01 09:54:49.021 INFO 41649 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2021-01-01 09:54:49.237 INFO 41649 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-01-01 09:54:49.248 INFO 41649 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-01-01 09:54:49.733 INFO 41649 --- [ main] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port(s): 7580
2021-01-01 09:54:49.746 INFO 41649 --- [ main] c.w.r.demo.ReactorCrudDemoApplication : Started ReactorCrudDemoApplication in 2.761 seconds (JVM running for 8.459) |
Je mets en zip le projet (j’utilise intelij comme IDE) téléchargeable ici https://www.grosfichiers.com/yLYRzgGg9gg
Merci de l'aide
Partager