Database Migrations

Slick itself does not have out-of-the-box support for database migrations, but there are some third-party tools that work well with Slick. This page provides a list of them.

Scala Forklift

Scala Forklift is a type-safe data migration tool with great support for Slick. Users can define their database migrations using either type-safe Slick queries or plain SQL queries. Scala Forklift will automatically apply the unapplied user-defined database migrations in the right order, and manage the Scala code corresponding to the database schemas using the Slick code generator.

An example can be found here.

An example of using Play, Slick, and Forklift can be found here.

slick-migration-api

slick-migration-api is a library for defining database migrations, for use with Slick. It supports altering database schemas using a type-safe Scala DSL.

Flyway

Flyway is a database migration tool that can run SQL or Java against a database.

SBT integration is available, and there is an example Play project that shows Flyway in a module with Slick code generation.

The source code for this page can be found here.