Before setting up your Liquibase Installer Example Workspace, you must copy the
examples directory to another location on your machine.
There are two projects under the examples directory:
examples/sqldirectory shows how to use a SQL formatted changelog.
examples/xmldirectory shows how to use an XML formatted changelog.
Both projects use the same setup and examples and only differ in the changelog type.
Starting the example H2 database
H2 is a standard SQL database and can be used to simulate anything you are required to do in your own database.
- To start the example database, run
- To stop the example database, use
examples/start-h2 starts a local H2 database that listens on port 9090 and opens a browser to the database console on the same port.
Note: The Example H2 database does not store data and will reset to its starting state when the start-h2 process ends.
About the console
start-h2 script starts two databases:
- Developer Database: Corresponds to what you may use as a local database
- Integration Database: Corresponds to another database in your pipeline
The web-based console allows you to see all objects in your database in the left navigation and run SQL statements on the right side.
Along the top is a toolbar that includes a Refresh button which can be used to reload the left-side object view if changes are made to your database outside of the console (like with Liquibase).
The Integration Database can be viewed with the link provided to you from the Developer database browser. You can also see which database you are connected to by looking at the URL at the top of the object view.
Perform a test run
As a test, try entering
create table test_table (id int) in the text area and click Run.
You should see
TEST_TABLE appear in the object view.
Next up: Run your first update