liquibase / liquibase-mongodb

MongoDB extension for Liquibase
Apache License 2.0
54 stars 47 forks source link

MongoDB extension breaks createIndex on MariaDB 10 #293

Open kabroxiko opened 2 years ago

kabroxiko commented 2 years ago

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 commented 2 years ago

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

kataggart commented 2 years ago

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!

alkismavridis commented 2 years ago

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")
FBurguer commented 2 years ago

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!

LeBezout commented 2 years ago

Same as #275 i think