我希望为现有Sybase数据库的项目设置Liquibase。我尝试过运行以下命令:
lb --driver=net.sourceforge.jtds.jdbc.Driver \
--classpath=C:\<home>\.m2\repository\net\sourceforge\jtds\jtds\1.2.8\jtds-1.2.8.jar \
--changeLogFile=testInitialChangelog.xml \
--url="jdbc:jtds:sybase://<host>:<port>/<dbname>" \
--username="<dbuser>" \
--password="<dbpwd>" \
--defaultSchemaName=<dbname> \
--logLevel=debug \
generateChangeLog
它不起作用 - 嗯,它产生了一个空的更改日志。输出是:
Picked up JAVA_TOOL_OPTIONS: -Duser.home=C:\<home>
DEBUG 29/06/17 17:07: liquibase: Connected to <dbuser>@jdbc:jtds:sybase://<host>:<port>/<dbname>
DEBUG 29/06/17 17:07: liquibase: Not adjusting the auto commit mode; it is already true
DEBUG 29/06/17 17:07: liquibase: Computed checksum for 1498752444338 as a8b042e5c46068977523e7071dff7a0f
WARNING 29/06/17 17:07: liquibase: Did not find schema '<dbname>' to snapshot
INFO 29/06/17 17:07: liquibase: Can not use class liquibase.serializer.core.yaml.YamlChangeLogSerializer as a Liquibase service because org.yaml.snakeyaml.representer.Representer is not in the classpath
INFO 29/06/17 17:07: liquibase: Can not use class liquibase.serializer.core.json.JsonChangeLogSerializer as a Liquibase service because org.yaml.snakeyaml.representer.Representer is not in the classpath
INFO 29/06/17 17:07: liquibase: testInitialChangelog.xml does not exist, creating
DEBUG 29/06/17 17:07: liquibase: MissingObjectChangeGenerator type order: liquibase.structure.core.Catalog liquibase.structure.core.Schema liquibase.structure.core.Sequence liquibase.structure.core.StoredProcedure liquibase.
structure.core.Table liquibase.structure.core.Column liquibase.structure.core.PrimaryKey liquibase.structure.core.UniqueConstraint liquibase.structure.core.Index liquibase.structure.core.ForeignKey liquibase.structure.core
.View
DEBUG 29/06/17 17:07: liquibase: UnexpectedObjectChangeGenerator type order: liquibase.structure.core.Catalog liquibase.structure.core.ForeignKey liquibase.structure.core.Schema liquibase.structure.core.StoredProcedure liqui
base.structure.core.UniqueConstraint liquibase.structure.core.View liquibase.structure.core.Table liquibase.structure.core.PrimaryKey liquibase.structure.core.Column liquibase.structure.core.Index liquibase.structure.core.
Sequence
DEBUG 29/06/17 17:07: liquibase: ChangedObjectChangeGenerator type order: liquibase.structure.core.Catalog liquibase.structure.core.ForeignKey liquibase.structure.core.Schema liquibase.structure.core.Sequence liquibase.struc
ture.core.StoredProcedure liquibase.structure.core.Table liquibase.structure.core.Column liquibase.structure.core.PrimaryKey liquibase.structure.core.UniqueConstraint liquibase.structure.core.Index liquibase.structure.core
.View
Liquibase 'generateChangeLog' Successful
答案 0 :(得分:2)
在这种情况下,它非常简单 - --defaultSchemaName=
参数。设置为defaultSchemaName=dbo
并且有效。