liquibase / liquibase-hibernate

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

auto-increment not applied to changelog #148

Open karolgebert opened 7 years ago

karolgebert commented 7 years ago

Hi,

I have a class like this:

@MappedSuperclass
@Getter
@Setter
@EntityListeners(AuditEntityListener.class)
class TrackedEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @CreatedOn
    @Temporal(TemporalType.TIMESTAMP)
    private Date creationDate;

    @ModifiedOn
    @Temporal(TemporalType.TIMESTAMP)
    private Date modificationDate;
}

and all my entities are extending from TrackedEntity. The problem is that in generated changelogfile column id doesn't have auto-increment set to true. It looks like this:

<changeSet author="kgebert (generated)" id="1489058420150-1">
        <createTable tableName="Building">
            <column name="id" type="BIGINT">
                <constraints nullable="false"/>
            </column>
            <column name="creationDate" type="timestamp"/>
            <column name="modificationDate" type="timestamp"/>
            <column name="name" type="VARCHAR(255)"/>
            <column name="complex_id" type="BIGINT"/>
        </createTable>
    </changeSet>

I am using MariaDB.

Am I missing something or it is a bug?

┆Issue is synchronized with this Jira Bug by Unito

aps-augentictech commented 3 years ago

I'm seeing the same behaviour but not on columns with @Id