Pay extra attention that our database location is the tmp directory, thus all changes shall be deleted once we reboot our workstation.

Once we have configured our database, we are ready to create our first SQL statement. Our scripts should be located in the conf/evolutions/{your database name} directory, in our case/conf/evolutions/default.

As we can see, we have ups and downs. What do they stand for? As you might have guessed, ups describe the transformations while downs describe how to revert them. So the next question would be how this functionality comes into use.

Suppose you have two developers working on 2.sql. Locally, they have successfully migrated their database. Once they are done, however, the merge result is far different than the file they executed on their database.

Evolutions detect whether the file is different and reverts the old revision by applying downs and then applying the up-to-date revision.

Now we are all set to run our application.

sbt run

Once we navigate to localhost:9000, we shall be presented with a screen that forces us to run the evolutions detected.

Let us go one step further and see what has been done to our database schema. We can easily explore an H2 database using dbeaver or your IDE. Upon issuing the show tables command, the results contain one extra table.

Once we start our application, we will be presented with a screen that forces us to issue an evolution for our different revision. If we hit apply, the users table shall contain the username field.

So the process of a new revision is pretty straightforward. The hash from the new 1.sql file is extracted. Then, a query checks whether the 1.sql file has already been applied. If it has been applied, a check is issued in case the hashes are the same. If they are not, then the downs script from the current database entry is executed. Once that's finished, the new script is applied.

Download AnzoGraph now and find out for yourself why it is acknowledged as the most complete all-in-one data warehouse for BI style and graph analytics.