liquibase / liquibase-hibernate

Liquibase Hibernate Integration
Apache License 2.0
271 stars 160 forks source link

Mine has a strange behavior, but with satisfactory result. The problem of `The application must supply JDBC connections` occurs, but it creates the changelog normally. #481

Closed rntjr closed 7 months ago

rntjr commented 1 year ago

Mine has a strange behavior, but with satisfactory result. The problem of The application must supply JDBC connections occurs, but it creates the changelog normally.

console log

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< br.midwest:folha-pagamento-service >-----------------
[INFO] Building folha-pagamento-service 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- liquibase-maven-plugin:4.4.2:diff (default-cli) @ folha-pagamento-service ---
[INFO] ------------------------------------------------------------------------
[INFO] Loading artifacts into URLClassLoader
[INFO]   artifact: file:/home/rntjr/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.7.10/spring-boot-starter-data-jpa-2.7.10.jar
[...]
[INFO] ------------------------------------------------------------------------
[project, pluginDescriptor]
[INFO] Parsing Liquibase Properties File
[INFO]   File: src/main/resources/liquibase.yaml
[INFO]   'classpath' in properties file is not being used by this task.
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] 
[INFO] Liquibase Community 4.4.2 by Datical
[INFO] ####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ## 
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ## 
##  Free schema change activity reports at        ##
##      https://hub.liquibase.com                 ##
##                                                ##
####################################################
Starting Liquibase at 08:17:54 (version 4.4.2 #39 built at 2021-07-22 18:11+0000)
[INFO] Settings
----------------------------
[INFO]     driver: org.postgresql.Driver
[INFO]     url: jdbc:postgresql://localhost:5432/folha_pagamento
[INFO]     username: *****
[INFO]     password: *****
[INFO]     use empty password: false
[INFO]     properties file: src/main/resources/liquibase.yaml
[INFO]     properties file will override? false
[INFO]     prompt on non-local database? true
[INFO]     clear checksums? false
[INFO]     changeLogDirectory: null
[INFO]     changeLogFile: src/main/resources/master.yaml
[INFO]     context(s): null
[INFO]     label(s): null
[INFO]     referenceDriver: liquibase.ext.hibernate.database.connection.HibernateDriver
[INFO]     referenceUrl: hibernate:spring:br.midwest.folhapagamentoservice.entity?dialect=org.hibernate.dialect.PostgreSQL95Dialect
[INFO]     referenceUsername: *****
[INFO]     referencePassword: *****
[INFO]     referenceDefaultSchema: null
[INFO]     diffChangeLogFile: src/main/resources/db/changelog/20230421111753_changelog.yaml
[INFO] ------------------------------------------------------------------------
[INFO] Parsing Liquibase Properties File src/main/resources/liquibase.yaml for changeLog parameters
[INFO] Executing on Database: jdbc:postgresql://localhost:5432/folha_pagamento
[INFO] Loading artifacts into URLClassLoader
[INFO]   artifact: file:/home/rntjr/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.7.10/spring-boot-starter-data-jpa-2.7.10.jar
[...]
[INFO] ------------------------------------------------------------------------
[INFO] Reading hibernate configuration hibernate:spring:br.midwest.folhapagamentoservice.entity?dialect=org.hibernate.dialect.PostgreSQL95Dialect
[INFO] Found package br.midwest.folhapagamentoservice.entity
[INFO] HHH000204: Processing PersistenceUnitInfo [name: default]
[INFO] HHH000412: Hibernate ORM core version 5.6.15.Final
[INFO] HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
[WARNING] HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
[WARNING] HHH000342: Could not obtain connection to query metadata
java.lang.UnsupportedOperationException: The application must supply JDBC connections
    at org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl.getConnection (UserSuppliedConnectionProviderImpl.java:44)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection (JdbcEnvironmentInitiator.java:181)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService (JdbcEnvironmentInitiator.java:68)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService (JdbcEnvironmentInitiator.java:35)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService (StandardServiceRegistryImpl.java:101)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService (AbstractServiceRegistryImpl.java:272)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService (AbstractServiceRegistryImpl.java:246)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService (AbstractServiceRegistryImpl.java:223)
    at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices (DefaultIdentifierGeneratorFactory.java:175)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies (AbstractServiceRegistryImpl.java:295)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService (AbstractServiceRegistryImpl.java:252)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService (AbstractServiceRegistryImpl.java:223)
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init> (InFlightMetadataCollectorImpl.java:173)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete (MetadataBuildingProcess.java:127)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata (EntityManagerFactoryBuilderImpl.java:1460)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build (EntityManagerFactoryBuilderImpl.java:1494)
    at liquibase.ext.hibernate.database.HibernateEjb3Database.buildMetadataFromPath (HibernateEjb3Database.java:59)
    at liquibase.ext.hibernate.database.HibernateDatabase.buildMetadata (HibernateDatabase.java:143)
    at liquibase.ext.hibernate.database.HibernateDatabase.setConnection (HibernateDatabase.java:83)
    at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation (DatabaseFactory.java:121)
    at liquibase.database.DatabaseFactory.openDatabase (DatabaseFactory.java:141)
    at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject (CommandLineUtils.java:90)
    at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.performLiquibaseTask (LiquibaseDatabaseDiff.java:240)
    at org.liquibase.maven.plugins.AbstractLiquibaseMojo.lambda$null$0 (AbstractLiquibaseMojo.java:475)
    at liquibase.Scope.lambda$child$0 (Scope.java:166)
    at liquibase.Scope.child (Scope.java:175)
    at liquibase.Scope.child (Scope.java:165)
    at liquibase.Scope.child (Scope.java:144)
    at org.liquibase.maven.plugins.AbstractLiquibaseMojo.lambda$execute$1 (AbstractLiquibaseMojo.java:401)
    at liquibase.Scope.lambda$child$0 (Scope.java:166)
    at liquibase.Scope.child (Scope.java:175)
    at liquibase.Scope.child (Scope.java:165)
    at liquibase.Scope.child (Scope.java:144)
    at liquibase.Scope.child (Scope.java:228)
    at liquibase.Scope.child (Scope.java:232)
    at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:338)
    at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.execute (LiquibaseDatabaseDiff.java:204)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[INFO] HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
[INFO] HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
[INFO] Envers integration enabled? : true
[INFO] HV000001: Hibernate Validator 6.2.5.Final
[INFO] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
[INFO] HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
[INFO] Using dialect org.hibernate.dialect.PostgreSQL95Dialect
[INFO] Performing Diff on database postgres @ jdbc:postgresql://localhost:5432/folha_pagamento (Default Schema: public)
[INFO] Found table dependente
[INFO] Found table dependente
[INFO] Found table contato_email_pessoa
[INFO] Found table contato_email_pessoa
[INFO] Found table pessoa
[INFO] Found table pessoa
[INFO] Found table beneficio_dependente
[INFO] Found table beneficio_dependente
[INFO] Found table contato_telefone_pessoa
[INFO] Found table contato_telefone_pessoa
[INFO] Found table pessoa
[INFO] Found primary key pessoaPK
[INFO] Found column id int8
[INFO] Found column create_at timestamp
[INFO] Found column tenant_id varchar(255)
[INFO] Found column update_at timestamp
[INFO] Found column uuid varchar(255)
[INFO] Found column bairro varchar(255)
[INFO] Found column categoria_cnh varchar(255)
[INFO] Found column cep varchar(255)
[INFO] Found column cid_pcd varchar(255)
[INFO] Found column cidade varchar(255)
[INFO] Found column complemento_endereco varchar(255)
[INFO] Found column concelho_ordem_profissional varchar(255)
[INFO] Found column cor_raca varchar(255)
[INFO] Found column cpf varchar(255)
[INFO] Found column data_emissao_cnh date
[INFO] Found column data_expedicao_ctps date
[INFO] Found column data_emissao_identidade date
[INFO] Found column data_expedicao_titulo_eleitor date
[INFO] Found column data_nascimento date
[INFO] Found column data_validade_cnh date
[INFO] Found column escolaridade varchar(255)
[INFO] Found column estado_civil varchar(255)
[INFO] Found column logradouro varchar(255)
[INFO] Found column nacionalidade varchar(255)
[INFO] Found column naturalidade varchar(255)
[INFO] Found column nome_completo varchar(255)
[INFO] Found column nome_conjuge varchar(255)
[INFO] Found column nome_mae varchar(255)
[INFO] Found column nome_social varchar(255)
[INFO] Found column numero_cnh varchar(255)
[INFO] Found column numero_ctps varchar(255)
[INFO] Found column numero_endereco varchar(255)
[INFO] Found column numero_identidade varchar(255)
[INFO] Found column numero_pis_pasep_nit_nis varchar(255)
[INFO] Found column numero_registro_concelho_ordem_profissional varchar(255)
[INFO] Found column numero_titulo_eleitor varchar(255)
[INFO] Found column orgao_expedidor_identidade varchar(255)
[INFO] Found column secao_titulo_eleitor varchar(255)
[INFO] Found column serie_ctps varchar(255)
[INFO] Found column sexo varchar(255)
[INFO] Found column tipo_pcd varchar(255)
[INFO] Found column uf int4
[INFO] Found column uf_ctps varchar(255)
[INFO] Found column uf_orgao_expedidor_identidade varchar(255)
[INFO] Found column uf_titulo_eleitor varchar(255)
[INFO] Found column zona_titulo_eleitor varchar(255)
[INFO] Found table contato_telefone_pessoa
[INFO] Found primary key contato_telefone_pessoaPK
[INFO] Found column id int8
[INFO] Found column create_at timestamp
[INFO] Found column tenant_id varchar(255)
[INFO] Found column update_at timestamp
[INFO] Found column uuid varchar(255)
[INFO] Found column isPrincipal boolean
[INFO] Found column telefone varchar(255)
[INFO] Found column pessoa_id int8
[INFO] Found table contato_email_pessoa
[INFO] Found primary key contato_email_pessoaPK
[INFO] Found column id int8
[INFO] Found column create_at timestamp
[INFO] Found column tenant_id varchar(255)
[INFO] Found column update_at timestamp
[INFO] Found column uuid varchar(255)
[INFO] Found column email varchar(255)
[INFO] Found column is_principal boolean
[INFO] Found column pessoa_id int8
[INFO] Found table dependente
[INFO] Found primary key dependentePK
[INFO] Found column id int8
[INFO] Found column create_at timestamp
[INFO] Found column tenant_id varchar(255)
[INFO] Found column update_at timestamp
[INFO] Found column uuid varchar(255)
[INFO] Found column cpf varchar(255)
[INFO] Found column data_limite_irpf date
[INFO] Found column data_salario_familia date
[INFO] Found column data_nascimento date
[INFO] Found column dependencia varchar(255)
[INFO] Found column escolaridade varchar(255)
[INFO] Found column estado_civil varchar(255)
[INFO] Found column is_dependente_financeiro boolean
[INFO] Found column is_dependente_pcd boolean
[INFO] Found column is_universitario boolean
[INFO] Found column naturalidade varchar(255)
[INFO] Found column nome_completo varchar(255)
[INFO] Found column parentesco varchar(255)
[INFO] Found column sexo varchar(255)
[INFO] Found column pessoa_id int8
[INFO] Found table beneficio_dependente
[INFO] Found primary key beneficio_dependentePK
[INFO] Found column id int8
[INFO] Found column create_at timestamp
[INFO] Found column tenant_id varchar(255)
[INFO] Found column update_at timestamp
[INFO] Found column uuid varchar(255)
[INFO] Found column codigo varchar(255)
[INFO] Found column data_final date
[INFO] Found column data_inicio date
[INFO] Found column dependente_id int8
BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed.
[INFO] changeSets count: 0
[INFO] No changesets to add.
[INFO] Differences written to Change Log File, src/main/resources/db/changelog/20230421111753_changelog.yaml
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.892 s
[INFO] Finished at: 2023-04-21T08:17:56-03:00
[INFO] ------------------------------------------------------------------------

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.10</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>br.midwest</groupId>
    <artifactId>folha-pagamento-service</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>folha-pagamento-service</name>
    <description>folha-pagamento-service</description>
    <properties>
        <java.version>11</java.version>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
        <spring.version>2.7.10</spring.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>${spring.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <version>${spring.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>4.21.1</version>
                <configuration>
                    <propertyFile>src/main/resources/liquibase.yaml</propertyFile>
                    <changeLogFile>src/main/resources/master.yaml</changeLogFile>
                    <outputChangeLogFile>src/main/resources/db/changelog/${maven.build.timestamp}_changelog.yaml
                    </outputChangeLogFile>
                    <diffChangeLogFile>src/main/resources/db/changelog/${maven.build.timestamp}_changelog.yaml
                    </diffChangeLogFile>
                    <verbose>true</verbose>
                    <dropFirst>false</dropFirst>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-data-jpa</artifactId>
                        <version>${spring.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-validation</artifactId>
                        <version>${spring.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.liquibase.ext</groupId>
                        <artifactId>liquibase-hibernate5</artifactId>
                        <version>4.21.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>

application.yaml

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/folha_pagamento
    username: postgres
    password: postgres
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: none
      properties:
        hibernate:
          dialect: org.hibernate.dialect.PostgreSQL95Dialect
          format_sql: true
  liquibase:
    change-log: classpath:master.yaml
    enabled: true

liquibase.yaml

url: jdbc:postgresql://localhost:5432/folha_pagamento
defaultSchemaName: public
username: postgres
password: postgres

classpath: src/main/resources
changeLogFile: src/main/resources/master.yaml

driver: org.postgresql.Driver
referenceUrl: hibernate:spring:br.midwest.folhapagamentoservice.entity?dialect=org.hibernate.dialect.PostgreSQL95Dialect
referenceDriver: liquibase.ext.hibernate.database.connection.HibernateDriver

master.xml

databaseChangeLog:
  - includeAll:
      path: ./db/changelog

generated changelog

databaseChangeLog:
- changeSet:
    id: 1682073923601-1
    author: rntjr (generated)
    changes:
    - createTable:
        columns:
        - column:
            autoIncrement: true
            constraints:
              nullable: false
              primaryKey: true
              primaryKeyName: beneficio_dependentePK
            name: id
            type: BIGINT
        - column:
            name: create_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: tenant_id
            type: VARCHAR(255)
        - column:
            name: update_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: uuid
            type: VARCHAR(255)
        - column:
            name: codigo
            type: VARCHAR(255)
        - column:
            name: data_final
            type: date
        - column:
            name: data_inicio
            type: date
        - column:
            name: dependente_id
            type: BIGINT
        tableName: beneficio_dependente
- changeSet:
    id: 1682073923601-2
    author: rntjr (generated)
    changes:
    - createTable:
        columns:
        - column:
            autoIncrement: true
            constraints:
              nullable: false
              primaryKey: true
              primaryKeyName: contato_email_pessoaPK
            name: id
            type: BIGINT
        - column:
            name: create_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: tenant_id
            type: VARCHAR(255)
        - column:
            name: update_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: uuid
            type: VARCHAR(255)
        - column:
            name: email
            type: VARCHAR(255)
        - column:
            name: is_principal
            type: BOOLEAN
        - column:
            name: pessoa_id
            type: BIGINT
        tableName: contato_email_pessoa
- changeSet:
    id: 1682073923601-3
    author: rntjr (generated)
    changes:
    - createTable:
        columns:
        - column:
            autoIncrement: true
            constraints:
              nullable: false
              primaryKey: true
              primaryKeyName: contato_telefone_pessoaPK
            name: id
            type: BIGINT
        - column:
            name: create_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: tenant_id
            type: VARCHAR(255)
        - column:
            name: update_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: uuid
            type: VARCHAR(255)
        - column:
            constraints:
              nullable: false
            name: isPrincipal
            type: BOOLEAN
        - column:
            name: telefone
            type: VARCHAR(255)
        - column:
            name: pessoa_id
            type: BIGINT
        tableName: contato_telefone_pessoa
- changeSet:
    id: 1682073923601-4
    author: rntjr (generated)
    changes:
    - createTable:
        columns:
        - column:
            autoIncrement: true
            constraints:
              nullable: false
              primaryKey: true
              primaryKeyName: dependentePK
            name: id
            type: BIGINT
        - column:
            name: create_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: tenant_id
            type: VARCHAR(255)
        - column:
            name: update_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: uuid
            type: VARCHAR(255)
        - column:
            name: cpf
            type: VARCHAR(255)
        - column:
            name: data_limite_irpf
            type: date
        - column:
            name: data_salario_familia
            type: date
        - column:
            name: data_nascimento
            type: date
        - column:
            name: dependencia
            type: VARCHAR(255)
        - column:
            name: escolaridade
            type: VARCHAR(255)
        - column:
            name: estado_civil
            type: VARCHAR(255)
        - column:
            name: is_dependente_financeiro
            type: BOOLEAN
        - column:
            name: is_dependente_pcd
            type: BOOLEAN
        - column:
            name: is_universitario
            type: BOOLEAN
        - column:
            name: naturalidade
            type: VARCHAR(255)
        - column:
            name: nome_completo
            type: VARCHAR(255)
        - column:
            name: parentesco
            type: VARCHAR(255)
        - column:
            name: sexo
            type: VARCHAR(255)
        - column:
            name: pessoa_id
            type: BIGINT
        tableName: dependente
- changeSet:
    id: 1682073923601-5
    author: rntjr (generated)
    changes:
    - createTable:
        columns:
        - column:
            autoIncrement: true
            constraints:
              nullable: false
              primaryKey: true
              primaryKeyName: pessoaPK
            name: id
            type: BIGINT
        - column:
            name: create_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: tenant_id
            type: VARCHAR(255)
        - column:
            name: update_at
            type: TIMESTAMP WITHOUT TIME ZONE
        - column:
            name: uuid
            type: VARCHAR(255)
        - column:
            name: bairro
            type: VARCHAR(255)
        - column:
            name: categoria_cnh
            type: VARCHAR(255)
        - column:
            name: cep
            type: VARCHAR(255)
        - column:
            name: cid_pcd
            type: VARCHAR(255)
        - column:
            name: cidade
            type: VARCHAR(255)
        - column:
            name: complemento_endereco
            type: VARCHAR(255)
        - column:
            name: concelho_ordem_profissional
            type: VARCHAR(255)
        - column:
            name: cor_raca
            type: VARCHAR(255)
        - column:
            name: cpf
            type: VARCHAR(255)
        - column:
            name: data_emissao_cnh
            type: date
        - column:
            name: data_expedicao_ctps
            type: date
        - column:
            name: data_emissao_identidade
            type: date
        - column:
            name: data_expedicao_titulo_eleitor
            type: date
        - column:
            name: data_nascimento
            type: date
        - column:
            name: data_validade_cnh
            type: date
        - column:
            name: escolaridade
            type: VARCHAR(255)
        - column:
            name: estado_civil
            type: VARCHAR(255)
        - column:
            name: logradouro
            type: VARCHAR(255)
        - column:
            name: nacionalidade
            type: VARCHAR(255)
        - column:
            name: naturalidade
            type: VARCHAR(255)
        - column:
            name: nome_completo
            type: VARCHAR(255)
        - column:
            name: nome_conjuge
            type: VARCHAR(255)
        - column:
            name: nome_mae
            type: VARCHAR(255)
        - column:
            name: nome_social
            type: VARCHAR(255)
        - column:
            name: numero_cnh
            type: VARCHAR(255)
        - column:
            name: numero_ctps
            type: VARCHAR(255)
        - column:
            name: numero_endereco
            type: VARCHAR(255)
        - column:
            name: numero_identidade
            type: VARCHAR(255)
        - column:
            name: numero_pis_pasep_nit_nis
            type: VARCHAR(255)
        - column:
            name: numero_registro_concelho_ordem_profissional
            type: VARCHAR(255)
        - column:
            name: numero_titulo_eleitor
            type: VARCHAR(255)
        - column:
            name: orgao_expedidor_identidade
            type: VARCHAR(255)
        - column:
            name: secao_titulo_eleitor
            type: VARCHAR(255)
        - column:
            name: serie_ctps
            type: VARCHAR(255)
        - column:
            name: sexo
            type: VARCHAR(255)
        - column:
            name: tipo_pcd
            type: VARCHAR(255)
        - column:
            name: uf
            type: INTEGER
        - column:
            name: uf_ctps
            type: VARCHAR(255)
        - column:
            name: uf_orgao_expedidor_identidade
            type: VARCHAR(255)
        - column:
            name: uf_titulo_eleitor
            type: VARCHAR(255)
        - column:
            name: zona_titulo_eleitor
            type: VARCHAR(255)
        tableName: pessoa
- changeSet:
    id: 1682073923601-6
    author: rntjr (generated)
    changes:
    - addForeignKeyConstraint:
        baseColumnNames: dependente_id
        baseTableName: beneficio_dependente
        constraintName: FK3ylg58dm91ibqvgdr7eprpoc1
        deferrable: false
        initiallyDeferred: false
        referencedColumnNames: id
        referencedTableName: dependente
        validate: true
- changeSet:
    id: 1682073923601-7
    author: rntjr (generated)
    changes:
    - addForeignKeyConstraint:
        baseColumnNames: pessoa_id
        baseTableName: contato_email_pessoa
        constraintName: FK4oqnho4yvejclv7hienlj4aoa
        deferrable: false
        initiallyDeferred: false
        referencedColumnNames: id
        referencedTableName: pessoa
        validate: true
- changeSet:
    id: 1682073923601-8
    author: rntjr (generated)
    changes:
    - addForeignKeyConstraint:
        baseColumnNames: pessoa_id
        baseTableName: contato_telefone_pessoa
        constraintName: FKd162t73p8oqd1tsygllaawtj8
        deferrable: false
        initiallyDeferred: false
        referencedColumnNames: id
        referencedTableName: pessoa
        validate: true
- changeSet:
    id: 1682073923601-9
    author: rntjr (generated)
    changes:
    - addForeignKeyConstraint:
        baseColumnNames: pessoa_id
        baseTableName: dependente
        constraintName: FKm16db97d4wyt8bw3mxp7w9do4
        deferrable: false
        initiallyDeferred: false
        referencedColumnNames: id
        referencedTableName: pessoa
        validate: true

Originally posted by @rntjr in https://github.com/liquibase/liquibase-hibernate/issues/381#issuecomment-1517676580

filipelautert commented 7 months ago

Fixed by https://github.com/liquibase/liquibase-hibernate/pull/616 .