Managing database versions with Liquibase and Spring Boot
5.0 (4 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
16 students enrolled

Managing database versions with Liquibase and Spring Boot

Learn how to make database changes, manage various code versions and update different environments with Liquibase
New
5.0 (4 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
16 students enrolled
Created by Arkadiusz Fronc
Last updated 6/2020
English
English [Auto]
Current price: $13.99 Original price: $19.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 2 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • define a database structure using Liquibase in XML format
  • upgrade and rollback database structure
  • integrate Liquibase with Spring Boot for automatic database creation and upgrade on application startup
  • use Liquibase for testing database upgrades and rollbacks
  • generate SQL upgrade and rollback scripts
Requirements
  • Understand basics of relational databases
  • Be able to write SQL statements that create tables, indexes etc.
  • Be able to pull source code from a Git repository
  • Be able to write Java code and use Spring Boot
  • Have IDE that allows creating Java web applications (e.g. IntelliJ IDEA, Eclipse)
Description

Do you want to stop frustration caused by manual database updates? Do you know that there is a free tool to help you out? If your answer is YES, it means that you might benefit from this course.


I start from the very beginning of using Liquibase. You should have some database and SQL knowledge. Basics of Java will increase your final satisfaction as I will also show you Liquibase integration with Spring Boot. I believe in practice so there will be mostly coding with some necessary theory. You will have many chances to try using Liquibase yourself because I included some exercises for you as well.


Get ready for an exiting journey to through Liquibase functionalities.

Who this course is for:
  • Java developers who want to make development and delivery of the database easy
Course content
Expand all 34 lectures 02:13:30
+ Introduction to database versioning
4 lectures 07:16

This is an introduction of me as an instructor. You will hear about my past experience and you will understand why I am a good person to talk about database versioning.

Preview 03:24

I present a high level plan of the course. You will know which subjects we will be talking about and practicing.

What you will learn
00:46

You will get a basic overview of technology that we will use during the course.

Technology
02:19

I will tell you what is the application that we will be working on during the course.

What we will build
00:47
+ Prepare the environment
4 lectures 15:36

I reveal the plan for this section.

Plan
00:50

I talk more about the sample application architecture and functionality. It will be easier for you to modify the code later.

Architecture and software overview
02:27

I talk about not obvious but necessary software that you must have to complete exercises for this course.

If you do not have Git, Java and MySQL installed and configured on your computer yet, you should have it after this lecture.

Commands used during this lecture

  • git --version
    It prints the current version of Git. It does not have to be a specific version but Git must be installed and the command should work.

Prerequisites
03:11

I show how to get the application source code from the Git repository, how to configure it and how to run it. After this lecture you should be able to do the same and have the dating platform for dogs configured and working on your computer.

Run the application
09:08
+ Database versioning - basic changesets
8 lectures 41:08

I define new feature requirement that involves updating the database structure. You will understand why we have to modify the database.

Task to modify the database structure
01:03

You will understand the difference between deployment of new application version and new database structure and why it requires different solutions. I will present you the database versioning concept that Liquibase follows.

Concept
04:29

You will be able to download, install and configure Liquibase and MySQL JDBC driver. After this lecture you should repeat my steps to have Liquibase ready on your computer.

Installing Liquibase and database driver
04:07

You will be able to define a basic database structure in Liquibase XML format. You will learn changeset syntax and some change types: table creation with columns, a primary key, autoincrement, not nullable constraints.

Db structure definition in Liquibase changesets
14:47

You will get a chance to upgrade a database using update Liquibase command. You will also see a sample error during execution and a solution to it.

Upgrading database
07:05

You will learn how to make data changes using Liquibase changesets.

Data changes and incremental database upgrade
05:54

You will understand Liquibase internals - how Liquibase knows which changesets have to be applied on a database.

How does incremental upgrade work?
02:17

I will define a task for you to practice changeset creation. You will be able to practice your knowledge.

Practice
01:26
Database versioning basics
3 questions
+ Development database
4 lectures 15:16

You will understand special needs of development database in software companies and why a single one shared with many developers is not a good solution.

Development database challenge
02:41

I will show you how to add H2 database to the project, integrate it with Spring Boot and use it instead of MySQL database.

In-memory H2 database
03:16

We will add Liquibase to the project to be configured by Spring Boot. You will learn how to use it to upgrade H2 database during each application start.

Liquibase integration with Spring Boot
02:56

You will learn how to add various types of data through a changeset: text, numbers and use subqueries in insert Liquibase changes. You will be able to split changesets across multiple files and nest one file in the other.

Sample data
06:23
+ Rollback
3 lectures 11:08

You will know why having a possibility of rolling back a database structure change is important.

Rolling back changes challenge
00:49

You will be able to revert changes from the database taking advantage of autorollback feature of Liquibase.

Autorollback
06:16

What to do if autorollback does not work? You will learn how to create a custom rollback for a changeset.

Custom rollback
04:03
Autorollback support
1 question
+ Production database
4 lectures 18:07

You will realize that the production environment often have its own requirements and you cannot avoid SQL scripts.

Production challenge
01:13

You learn how to apply a tag on the database and how to roll back to that tag. You will also see how to rollback to a specific timestamp.

Tag, upgrade and rollback commands
07:01

You will learn how to prepare upgrade and rollback SQL scripts for a database when you cannot use Liquibase XML changesets directly.

Generate upgrade, rollback SQL scripts
06:36

You get familiar with a fast and automatic way of testing changesets for update and rollback procedures.

Testing upgrade and rollback
03:17
Liquibase commands
3 questions
+ Best practices
3 lectures 10:21

I will tell you when to look for information about Liquibase.

Introduction
00:53

I will explain you why you should create new changesets instead of modifying existing ones. I will show you how Liquibase checks this rule using a hash. And in the mean time you will also learn a new command - dropAll.

Changeset hash
08:29

You will understand why you should never mix more than one change per changeset.

One change per changeset
00:59
Best practices
3 questions
+ Exercises
4 lectures 14:38

I will invite you to a series of exercises to practice using Liquibase.

Introduction
00:29

You will practice Liquibase commands.

Exercise 1
01:52

You will practice creating various types of changes while preserving existing data and securing rollback possibility for the future.

Exercise 2
07:31

You will practice creating custom not obvious rollbacks.

Exercise 3
04:46