尝试升级/迁移数据库时,我似乎遇到了异常。我似乎一直在工作,直到它到达某一行,即 48586。我重新测试,好像数据已损坏,但同样的事情再次发生。mysql 试图做的是删除表 Logs 的当前主键,然后添加新的主键IP
, logId
, logTime
。
SEVERE 10/15/12 2:27 PM:liquibase: Error executing SQL ALTER TABLE `Logs` ADD PRIMARY KEY (`IP`, `logId`, `logTime`)
java.sql.SQLException: Data truncated for column 'logTime' at row 48586
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2569)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:824)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:667)
at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:105)
at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1014)
at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:998)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
at liquibase.Liquibase.update(Liquibase.java:113)
at liquibase.integration.commandline.Main.doMigration(Main.java:684)
at liquibase.integration.commandline.Main.main(Main.java:116)