mysql-enable-dbcl-primary-key

--mysql-enabled-dbcl-primary-key is a global parameter that allows you to add a primary key for MySQL databases. By default, Liquibase does not create primary keys on its DATABASECHANGELOG table. This is because Liquibase aims to maintain broad compatibility across many database types.

If you need to use a primary for your MySQL database, you must set --mysql-enabled-dbcl-primary-key to true before you apply Liquibase to your DATABASECHANGELOG table. You can't retrofit a DATABASECHANGELOG table with a primary key after it has been created.

Note: You can remove a primary key using the SQL command ALTER TABLE DATABASECHANGELOG DROP PRIMARY KEY;

Syntax

You can set this parameter in the following ways:

Option

Syntax

Liquibase properties file (defaults file)

liquibase.mysqlEnableDbclPrimaryKey: <true|false>

Global flow file argument

command: mysql-enable-dbcl-primary-key

Global CLI parameter

liquibase --mysql-enable-dbcl-primary-key=<true|false>

JVM system property (JAVA_OPTS environment variable)

Unix:

JAVA_OPTS=-Dliquibase.mysql-enable-dbcl-primary-key=<true|false>

Windows:

JAVA_OPTS=-D"liquibase.mysql-enable-dbcl-primary-key"=<true|false>

Liquibase environment variable

LIQUIBASE_COMMAND_CHANGELOG_FILE=<string>

mysql-enable-dbcl-primary-key - Liquibase