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) |
|
Global flow file argument (example) |
|
Global CLI parameter |
|
JVM system property (JAVA_OPTS Environment Variable) |
Unix:
Windows:
|
Liquibase Environment Variables |
|
Related Links
- For more information, see Working with Command Parameters.