Refine Your App

Okay, enough with the overview. Let’s write some code.

Managing Database Migrations

The first thing we need to do is to initialize the database. The template generates two example migration files in the resources/migrations folder. Note the date on your files will be different since it’s set to the date the application was instantiated. Let’s delete the files generated by the template before proceeding.

 $ ​​rm​​ ​​resources/migrations/*

Next, let’s see how to add migrations that are appropriate for our application. New pairs of migration files can be generated from the REPL by running the create-migration function:

 user=>​ (​create-migration​ ​"guestbook"​)
 nil
 user=>

A common beginner error that you may encounter ...

Get Web Development with Clojure, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.