If you are building an application with Spring Boot, handling the database changes becomes a nightmare over time. The more changes you add, the more changes you have to maintain for your database. Liquibase is the best solution out there. In this post, we will show how to handle database changes using liquibase.
Liquibase is an open-source library to track, manage, and apply database changes. Liquibase tracks the changes to database through an XML configuration where a developer will usually add changesets.
Each changeset will have an id and author attributes. Liquibase uses a changelog to track the database changes. Every changeset you add, that will get added in the changelog. Changelog is a ledger of all the changes you are doing to database.
To track database changes, you will write an XML file that is platform-independent. This XML file will be used on the command line to translate into scripts for your database engine.
We can also use a maven or Gradle plugin to include database changes in the build configuration.
Liquibase uses its own tables to track changes. Those tables will be part of the schema you are building for consistency purposes. It records the hash of each changeset.
Previously, I mentioned you can write a changeset using XML. But liquibase also offers the support for JSON or YAML.
As part of this post, I will show how I add a changeset and generate scripts for the database.
Create an XML changelog file
db.changelog-master.xml for our database under folder
src\main\resources\db. Usually, if you start using liquibase from the start of the project, you will create an initial changelog file that will generate initial scripts. You can track every change after that through a change set.
#database #coding #software #software-development #software-engineering
#spring boot #spring boot tutorial #interceptor #interceptors #spring boot interceptor #spring boot tutorial for beginners
As an extension of the Spring Framework, Spring Boot is widely used to make development on Spring faster, more efficient and convenient. In this article, we will look at some of the parameters were using Spring Boot can drastically reduce the time and effort required in application development.
#full stack development #spring #spring and spring boot #spring boot
In the video below, we take a closer look at the How to configure log4j2 in the Spring boot application using log4j2.xml? | Spring Boot logging. Let’s get started!
#java #spring boot #video #log4j #spring boot tutorial #spring boot tutorial for beginners
In this tutorial, I am going to show you how easy it is to create a web application with Spring Boot 2, along with the
embedded Tomcat + JSP template and JSP views.
You can get the blueprint from the Spring Initializer page.
#java #tutorial #spring boot #jsp #spring boot 2 #spring boot tutorial #jsp view
In SSMS, we many of may noticed System Databases under the Database Folder. But how many of us knows its purpose?. In this article lets discuss about the System Databases in SQL Server.
Fig. 1 System Databases
There are five system databases, these databases are created while installing SQL Server.
#sql server #master system database #model system database #msdb system database #sql server system databases #ssms #system database #system databases in sql server #tempdb system database