Error in liquibase changelog FK Index on ManyToOne with User

Hello

I have created an entity with ManyToOne with User but generated liquibase changelog has instead of which gives error. Below is the generated changelog:

    <changeSet id="159" author="project">
        <addForeignKeyConstraint baseColumnNames="USER_ID" baseTableName="V_GUARDIAN"
                                 constraintName="FK_V_GUARDIAN_ON_USER" referencedColumnNames="ID"
                                 referencedTableName="USER_"/>

        <createPartialIndex indexName="IDX_UC_V_GUARDIAN_USER" tableName="V_GUARDIAN" unique="true">
            <column name="USER_ID"/>
        </createPartialIndex>
    </changeSet>

Please check

What database do you use?
Also, please provide source code of your entities.

I am using Postgresql

Column Definition:

@NotNull
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "USER_ID", unique = true)
private User user;

User is default entity generated by Jmix

Cannot reproduce on Studio 1.1.4.
Could you provide a test project?

Sorry I forgot to mention Jmix Version, it’s. 1.1.2. BTW, how are you using 1.1.4, it’s not even in Github tags. Is this a typo? I don’t even get unstable versions in my Intellij

image

Issue is resolved. Entity class was migrated from CubaPlatform and this was missing indexes={} in @Table annotation. Just removed/added column using designer and issue was fixed.

1 Like

Still interested in 1.1.4 :slightly_smiling_face:

Hi,

1.1.4 was meant the Jmix studio IntelliJ plugin. The framework still has version 1.1.2, so you are on latest :slight_smile:

Bye
Mario