liquibase-mongodb icon indicating copy to clipboard operation
liquibase-mongodb copied to clipboard

MongoDB extension breaks createIndex on MariaDB 10

Open kabroxiko opened this issue 2 years ago • 5 comments

Environment

Liquibase Version: 4.15.0

Liquibase Integration & Version: CLI

Database Vendor & Version: mariadb 10

Description

createIndex doesn't do anything

Steps To Reproduce

Use:

    <changeSet author="myself" id="createTablePerson">
        <createTable tableName="users">
            <column name="id" type="BIGINT">
                <constraints nullable="false"/>
            </column>
            <column name="phone" type="BIGINT">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>
    <changeSet author="myself" id="createIndexId">
        <createIndex indexName="idx_users_id" tableName="users">
            <column name="id"/>
        </createIndex>
    </changeSet>
    <changeSet author="myself" id="createIndexPhone">
        <sql>CREATE INDEX idx_users_phone ON users(phone);</sql>
    </changeSet>

Actual Behavior

The createIndex doesn't give an error and doesn't create any index, the workaround is to create the index with sql command.

Expected/Desired Behavior

createIndex must create the index always or give an error.

kabroxiko avatar Sep 07 '22 13:09 kabroxiko

I've found that the problem appears when the mongodb plugin is installed

kabroxiko avatar Sep 07 '22 23:09 kabroxiko

Hey there @kabroxiko - can you please clarify what you were trying to do in which database platform and the details of your Liquibase installation? You noted in the description that it was mariadb, but then said you found a problem in the mongodb plugin. Are you trying to apply the changelog to mariadb or mongo? Assume you have installed the mongodb if you believe there is a problem with it? What are the details of the problem with the plugin that you see? Thanks!

kataggart avatar Sep 08 '22 13:09 kataggart

Also affected. And I also have the mongo plugin installed. We migrate from mongo to sql, so we need to have both enabled for a while.

DB: Postgress Liquibase Versions (from our gradle file):

  implementation(group = "org.liquibase", name = "liquibase-core", version = "4.8.0")
  implementation(group = "org.liquibase.ext", name = "liquibase-mongodb", version = "4.8.0")

alkismavridis avatar Sep 29 '22 14:09 alkismavridis

Managed to reproduce this issue with liquibase and liquibase-mongodb 4.16.1. We will add this issue to our list of issues to fix. Thanks!

FBurguer avatar Sep 30 '22 15:09 FBurguer

Same as #275 i think

LeBezout avatar Oct 05 '22 19:10 LeBezout