Book Image

Lift Application Development Cookbook

By : Gilberto Tadeu Garcia Jun
Book Image

Lift Application Development Cookbook

By: Gilberto Tadeu Garcia Jun

Overview of this book

Developing secure web applications is one of the most important tasks developers have to deal with. With Lift, it is easy to create solid and formidable web applications as it is the most secure web framework available today. The View-First approach and being able to handle things as purely data transformation, makes working with Lift an exciting task. "Lift Application Development Cookbook" teaches you how to build web applications using this amazing framework. The book moves gradually, starting with the basics (starting a new project, submitting a form, and so on) before covering more advanced topics such as building a REST API and integrating your application with other technologies and applications. "Lift Application Development Cookbook" takes you on a journey of creating secure web applications. Step-by-step instructions help you understand how things work and how various elements relate to each other. You'll learn different ways to process a form, build dynamic HTML pages, and create an API using REST. You'll also learn how to work with relational and NoSQL databases and how to integrate your application with other technologies as well as with third-part applications such as Gmail and Facebook. By the end of the book, you will be able to understand how Lift works and be able to build web applications using this amazing and exciting framework.
Table of Contents (15 chapters)
Lift Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Migrating the database using Liquibase


Squeryl doesn't do database migration for us. This means that you can use the create method from the schema object only once, because it tries to create all of the tables each time it runs and it will give errors when trying to create a table that already exists.

For this reason, we can use third-party tools such as Liquibase, in order to automate the migration process; that is, database creation and changing. Liquibase uses an XML file, databaseChangeLog, to define all of the changes that it needs to execute. Each one of these changes is defined by a changeSet tag. It also keeps track of these changeSet tags to prevent executing any one of them twice.

Once you define your databaseChangeLog file—the XML file that contains the changeSet tags—you can tell Lift to execute it during application startup. So, whenever you change your database, all you need to do is to create the changeSet tags, add them into the changelog file and during the next deployment...