Liquibase在generateChangeLog

时间:2019-05-15 20:45:16

标签: liquibase

运行

  

liquibase generateChangeLog> genChgLog.txt

将以下内容作为我的liquibase.properties,

  

classpath = C:\ Program Files(x86)\ MySQL \ MySQL Connector    J \ mysql-连接器-java-8.0.16.jar   driver = com.mysql.cj.jdbc.Driver   url = jdbc:mysql:// {thisisnottheproblem,Iguarantee}   用户名= {正确}   密码= {正确}   referenceUrl = jdbc:mysql:// {thisisnottheproblem,Iguarantee}   referenceUsername = {正确}   referencePassword = {正确}   changeLogFile = databaseChangeLogSchema.mysql.sql   diffTypes =表,列,视图,主键,索引,外键,序列,数据   logLevel = debug

我一直都喜欢这样,将其输出到genChgLog.txt文件:

  

CDT 2019年5月15日星期三15:37:32启动Liquibase(版本3.6.3   建于2019-01-29 11:34:48)运行Liquibase发生意外错误:   liquibase.exception.DatabaseException:   liquibase.exception.DatabaseException:未知表   'TMP_CTAWHBNCQVQMHSUU'[失败的SQL:DROP TABLE TMP_CTAWHBNCQVQMHSUU]   liquibase.exception.LiquibaseException:   liquibase.command.CommandExecutionException:   liquibase.exception.DatabaseException:   liquibase.exception.DatabaseException:未知表   'TMP_CTAWHBNCQVQMHSUU'[失败的SQL:DROP TABLE TMP_CTAWHBNCQVQMHSUU]     在   liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:279)     在liquibase.integration.commandline.Main.doMigration(Main.java:1058)     在liquibase.integration.commandline.Main.run(Main.java:199)处   liquibase.integration.commandline.Main.main(Main.java:137)由以下原因引起:   liquibase.command.CommandExecutionException:   liquibase.exception.DatabaseException:   liquibase.exception.DatabaseException:未知表   'TMP_CTAWHBNCQVQMHSUU'[失败的SQL:DROP TABLE TMP_CTAWHBNCQVQMHSUU]     在liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)     在   liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:277)     ...省略了3个共同的框架   liquibase.exception.DatabaseException:   liquibase.exception.DatabaseException:未知表   'TMP_CTAWHBNCQVQMHSUU'[失败的SQL:DROP TABLE TMP_CTAWHBNCQVQMHSUU]     在   liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:223)     在   liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66)   。 。 。在   liquibase.command.core.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:46)     在liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)     ...省略了4个共同的框架   liquibase.exception.DatabaseException:未知表   'TMP_CTAWHBNCQVQMHSUU'[失败的SQL:DROP TABLE TMP_CTAWHBNCQVQMHSUU]     在   liquibase.executor.jvm.JdbcExecutor $ ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356)     在liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57)     在liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125)     在liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:109)     在   liquibase.database.core.MySQLDatabase.hasBugJdbcConstraintsDeferrable(MySQLDatabase.java:294)     在   liquibase.snapshot.jvm.ForeignKeySnapshotGenerator.snapshotObject(ForeignKeySnapshotGenerator.java:188)     ...省略了25个共同的框架   java.sql.SQLSyntaxErrorException:未知表'TMP_CTAWHBNCQVQMHSUU'     在   com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)     在   com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)     在   com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)     在   com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)     在com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)     在   liquibase.executor.jvm.JdbcExecutor $ ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352)     ...省略了30个普通框架

     

有关更多信息,请使用--logLevel标志

每次运行它时,它都会更改幻像TMP_表的名称(尽管它们始终以TMP_开头,然后是一串显然是随机的字符)。我不知道要从哪里删除这些不存在的TMP_表,但是...是否有某种方法可以使其仅尝试删除它们(如果存在)?可能需要注意的是:如果我唯一的diffType是“ tables”,“ data”,或者如果我同时拥有“ tables”和“ data”作为diffTypes,它就可以正常工作...否则,失败...

1 个答案:

答案 0 :(得分:1)

我没有所有详细信息,但是当使用权限不足的数据库用户时,似乎会发生这种情况。我与某人交谈,他说使用根级数据库用户可以为他们解决此问题。