addColumn fails against sqlite3 due to index conflict - trivial example attached

Hi All,

We use liquibase to manage some schemas for Postgres and MS SQLServer, it works well against those db’s

For local tests, though, we use sqlite3, and I’ve been having all manner of problems applying changelogs to sqlite, but I’ve not been able to solve this particular one (YAML changelog attached).

The problem boils down to the fact that sqlite automatically creates a primary key index for any field tagged as a PK, but when you add a column to a table that has a pk (on unrelated columns), it tries to explicitly create the implicit index, which fails due to a conflict.

In my example, I make a table with a field named “name”, which has a pk constraint, then I add another changeset to create a column named address, and that fails with the following error. How do I work around this? I don’t want liquibase to be creating an already existing auto-index.

WARNING 8/9/16 9:40 PM: liquibase: test.yaml: test.yaml::2::test: Did not find catalog ‘DEFAULT’ to snapshot

WARNING 8/9/16 9:40 PM: liquibase: test.yaml: test.yaml::2::test: Did not find catalog ‘DEFAULT’ to snapshot

SEVERE 8/9/16 9:40 PM: liquibase: test.yaml: test.yaml::2::test: Change Set test.yaml::2::test failed. Error: [SQLITE_ERROR] SQL error or missing database (object name reserved for internal use: sqlite_autoindex_jimbob_1) [Failed SQL: CREATE UNIQUE INDEX sqlite_autoindex_jimbob_1 ON jimbob(name)]

INFO 8/9/16 9:40 PM: liquibase: test.yaml::2::test: Successfully released change log lock

Unexpected error running Liquibase: [SQLITE_ERROR] SQL error or missing database (object name reserved for internal use: sqlite_autoindex_jimbob_1) [Failed SQL: CREATE UNIQUE INDEX sqlite_autoindex_jimbob_1 ON jimbob(name)]

SEVERE 8/9/16 9:40 PM: liquibase: test.yaml::2::test: [SQLITE_ERROR] SQL error or missing database (object name reserved for internal use: sqlite_autoindex_jimbob_1) [Failed SQL: CREATE UNIQUE INDEX sqlite_autoindex_jimbob_1 ON jimbob(name)]