🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# C.50 LiquibaseTask The `LiquibaseTask` is a generic task for liquibase commands that don't require extra command parameters. You can run commands like `updateSQL`, `validate` or `updateTestingRollback` with this task but not `rollbackToDateSQL` since it requires a date parameter after the command. Table C.59:聽Attributes NameTypeDescriptionDefaultRequired`jar``String`Location of the Liquibase jar file.n/aYes`classpath``String`Additional classpath entries.n/aYes`changeLogFile``String`Location of the changelog file in which the changes get written or read from.n/aYes`username``String`The username needed to connect to the database.n/aYes`password``String`The password needed to connect to the database.n/aYes`url``String`The JDBC Url representing the database datasource, e.g `jdbc:mysql://localhost/mydatabase`n/aYes`command``String`What liquibase command to run. Currently only supports commands that doesn't require command parameters, such as validate and updateSQL.n/aYes`display``Boolean`Whether to display the output of the command. Only used if `passthru` isn't true.falseNo`passthru``Boolean`Whether to use PHP's `passthru()` function instead of `exec()`. True by default for backwards compatibility. When true, the attributes `display`, `outputProperty` and `checkReturn`are ignored.trueNo`checkreturn``Boolean`Whether to check the return code of the execution, throws a BuildException when returncode != 0.falseNo`outputProperty``String`Property name to set output value to from the execution. Ignored if `passthru` attribute is true.n/aNo C.50.1 Example ``` <liquibase jar="./vendor/alcaeus/liquibase/liquibase.jar" classpathref="./libs/mysql-connector-java.jar" changelogFile="./DB/master.xml" username="${deploy.user}" password="${deploy.password}" url="jdbc:mysql://${database.host}/${database.name}" display='true' checkreturn="true" passthru='false' outputProperty="liquibase.updateSQL.output" command="updateSQL" > <parameter name="logLevel" value="info" /> <property name="tablename" value="Person" /> </liquibase> ``` The nested parameters in the example above will result in the command: ``` --logLevel='info' updateSQL -Dtablename='Person' ``` C.50.2 Supported Nested Tags - `parameter` Use these nested parameter tags to set optional liquibase commands like --logLevel or --defaultsFile. Table C.60:聽Attributes NameTypeDescriptionDefaultRequired`name``String`Name of the liquibase parameter. Do not include the '--'.n/aYes`value``String`Value of the liquibase parameter.n/aYes - `property` These tags are used to set what Liquibase calls "Change Log Properties" which are used for substitution in the change log(s). Note that they are not the same thing as regular Phing properties. Table C.61:聽Attributes NameTypeDescriptionDefaultRequired`name``String`Name of the property. Do not include the '-D'.n/aYes`value``String`Value of the property.n/aYes