Skip to content

Preparing the Database

testinfected edited this page Aug 31, 2012 · 3 revisions

##Migrating the database

To apply pending migrations, from the petstore-infrastructure module, run:

mvn db-migration:migrate

To migrate a database other than the default one, use a different maven build profile.

Rebuilding the database

To recreate the database entirely by dropping all tables and re-applying migrations, from the petstore-infrastructure module, run:

mvn db-migration:reset

To recreate a database other than the default one, use a different maven build profile.

Populating a database with test data

In order to populate a database with test data when manually testing the application, from the petstore-infrastructure module, run:

mvn sql:execute

This executes all SQL scripts found under directory petstore-infrastructure/src/main/scripts/seeds/ on the database associated with the active profile.