首页 > 解决方案 > 如何在 node.js 中使用自定义更改

问题描述

我开发了一些实现 CustomTaskChange 的类并构建了一个 jar 文件。然后我在 liquibase 类路径中加载了那个 jar


const myConfig = {
  ...POSTGRESSQL_DEFAULT_CONFIG,
  changeLogFile: 'db/master/changelog.xml',
  url: 'jdbc:postgresql://localhost:5432/saft-demo-dump?allowMultiQueries=TRUE',
  username: 'postgres',
  password: '*******',
  classpath:"jar/postgresql-42.2.20.jar;jar/migrations-0.0.1-SNAPSHOT.jar"
}
const instTs = new LiquibaseTS(myConfig);

我正在尝试通过 XML 文件访问一个类,但我得到了一个ClassNotFoundException。我该如何使用它?

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
    <changeSet author="fabio" id="bd69067q-qr00-4400-902b-0091c5d29681">
        <customChange class="liquibase.change.custom.CustomChange.MultipleAdd"
                      suffix="transactions" columnName="NODE_COLUMN" columnType="varchar(250)">

        </customChange>
    </changeSet>
</databaseChangeLog>

标签: node.jsxmljarmigrationliquibase

解决方案


这可能是因为我们必须:在 classpath 属性中使用分隔符,而不是;.


推荐阅读