mysqlliquibaseliquibase-sql

Liquibase create schema for MySQL


Is there any way to create schema through liquibase script ?

After some research I've found out that we need to include a create schema in change log file.

I'm thinking on similar terms for question asked previously for postgres

Any pointers or help is welcomed.


Solution

  • Found an answer that was mentioned already on stackoverflow.

    We can create a fresh database using this URL.

    jdbc:mysql://localhost:3306/database_name?createDatabaseIfNotExist=true
    

    createDatabaseIfNotExist this keyword create a fresh new database in your system. If the database does not exist. if exist, skip executing.