I'm trying to use liquibase for generating the changeLog, starting by snapshoting the current state of my database.
Environment details:
I run the following from command line:
liquibase --driver=com.mysql.jdbc.Driver --changeLogFile=./structure.xml --url="jdbc:mysql://mysql.mysite.com" --username=<myuser> --password=<mypass> generateChangeLog
It runs fine, and generated the output file. But the output file just contains:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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-2.0.xsd"/>
And no tables are created on my database (I was expecting the two tables used for tracking).
What am I missing?
EDITS
Yes, I'm referring to liquibasechanlog and liquibasechangelock tables. I know they should automatically appears on database. My question is why they aren't there. And yes, the provided user have the rights granted for doing such task.
And it is not an empty database. It has near 20 tables, 10 views, data...
Just specify the database name with the --url
flag like ZNK said:
--url="jdbc:mysql://mysql.mysite.com/database_name_here"
I had faced similar issue when generating changelog xml for postgresql database. I'm posting here if it can help someone.
I had to specify --defaultSchemaName
in addition to the above params. So in mysql you will have similar option:
The final command will look like :
liquibase --driver=org.postgresql.Driver --changeLogFile=db.changelog.xml --classpath=postgresql-9.4-1201-jdbc41.jar --url="jdbc:postgresql://localhost:5432/wms" --username=<USER_NAME> --password=<PASSWD> --defaultSchemaName=<SCHEMA_NAME> generateChangeLog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With