Create first snapshot Error

command:liquibase --changeLogFile=mydatabase_changelog.xml generateChangeLog
Unexpected error running Liquibase: Column ‘REFERENCED_TABLE_NAME’ in where clause is ambiguous
version:liquibase-4.4.3
OS:win10
database:MySQL 5.7

details:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘REFERENCED_TABLE_NAME’ in where clause is ambiguous
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
at com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema.executeMetadataQuery(DatabaseMetaDataUsingInfoSchema.java:50)
at com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema.getImportedKeys(DatabaseMetaDataUsingInfoSchema.java:780)
at liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData$ForeignKeysResultSetCache.fastFetch(JdbcDatabaseSnapshot.java:653)
at liquibase.snapshot.ResultSetCache.get(ResultSetCache.java:72)
… 52 more

Hi @thewbb

Could you please provide some more details:

  1. Liquibase version
  2. Database you are using
  3. The exact command you run
  4. liquibase.properties file

Thanks,
Rakhi Agrawal

1 Like

changeLogFile:dbchangelog.xml
url: jdbc:mysql://localhost:3306/xbio_sms1?characterEncoding=UTF-8&allowMultiQueries=true
username: root
password: ********
classpath: mysql-connector-java-5.1.6.jar