Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Não está criando a tabela medicos

Boa tarde,

A tabela médicos não está sendo criada, e não estou conseguindo achar o motivo. No console aparece essa mensagem: "No migrations found. Are your locations set up correctly?"

Segue o log completo:

2023-01-30T16:14:48.356-03:00  INFO 18344 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-01-30T16:14:48.365-03:00  INFO 18344 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-01-30T16:14:48.366-03:00  INFO 18344 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.4]
2023-01-30T16:14:48.464-03:00  INFO 18344 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-01-30T16:14:48.464-03:00  INFO 18344 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1256 ms
2023-01-30T16:14:48.607-03:00  INFO 18344 --- [           main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 9.5.1 by Redgate
2023-01-30T16:14:48.608-03:00  INFO 18344 --- [           main] o.f.c.internal.license.VersionPrinter    : See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#9.5.1
2023-01-30T16:14:48.608-03:00  INFO 18344 --- [           main] o.f.c.internal.license.VersionPrinter    : 
2023-01-30T16:14:48.614-03:00  INFO 18344 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-01-30T16:14:48.884-03:00  INFO 18344 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1f10fec6
2023-01-30T16:14:48.886-03:00  INFO 18344 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2023-01-30T16:14:48.916-03:00  INFO 18344 --- [           main] o.f.c.i.database.base.BaseDatabaseType   : Database: jdbc:mysql://localhost:3306/vollmed_api (MySQL 8.0)
2023-01-30T16:14:48.950-03:00  INFO 18344 --- [           main] o.f.core.internal.command.DbValidate     : Successfully validated 0 migrations (execution time 00:00.010s)
2023-01-30T16:14:48.950-03:00  WARN 18344 --- [           main] o.f.core.internal.command.DbValidate     : No migrations found. Are your locations set up correctly?
2023-01-30T16:14:48.963-03:00  INFO 18344 --- [           main] o.f.core.internal.command.DbMigrate      : Current version of schema `vollmed_api`: << Empty Schema >>
2023-01-30T16:14:48.964-03:00  INFO 18344 --- [           main] o.f.core.internal.command.DbMigrate      : Schema `vollmed_api` is up to date. No migration necessary.
2023-01-30T16:14:49.041-03:00  INFO 18344 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-01-30T16:14:49.108-03:00  INFO 18344 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.6.Final
2023-01-30T16:14:49.381-03:00  WARN 18344 --- [           main] org.hibernate.orm.deprecation            : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2023-01-30T16:14:49.598-03:00  INFO 18344 --- [           main] SQL dialect                              : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2023-01-30T16:14:50.994-03:00  INFO 18344 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2023-01-30T16:14:51.018-03:00  INFO 18344 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-01-30T16:14:51.440-03:00  WARN 18344 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2023-01-30T16:14:51.874-03:00  INFO 18344 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-01-30T16:14:51.883-03:00  INFO 18344 --- [           main] daniel.xavier.api.ApiApplication         : Started ApiApplication in 5.101 seconds (process running for 5.888)

Imagem de como está o código sql e os diretórios:

Insira aqui a descrição dessa imagem para ajudar na acessibilidade

Insira aqui a descrição dessa imagem para ajudar na acessibilidade

2 respostas
solução!

Oi Daniel!

Você criou a pasta das migrations com o nome errado. O correto é db e não bd.

Perfeito rsrs, valeu!