Liquibase - how to generate a changelog for existing database

后端 未结 2 504
不知归路
不知归路 2020-12-15 23:24

I\'m trying to use liquibase for generating the changeLog, starting by snapshoting the current state of my database.

Environment details:

  • OS: Windows 7
相关标签:
2条回答
  • 2020-12-16 00:12

    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   
    
    0 讨论(0)
  • 2020-12-16 00:13

    Just specify the database name with the --url flag like ZNK said:

      --url="jdbc:mysql://mysql.mysite.com/database_name_here"
    
    0 讨论(0)
提交回复
热议问题