Skip to content
Example of how to set up migrations in Clojure using Korma, Drift, and PostgreSQL.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Example templates for using Drift migrations with Korma and PostgreSQL >= 9.0.


Copy the file src/config/migrate_config.clj to your project and edit the database connection credentials as appropriate.

When you run the migrations, a table called schema_version will be created in your database, containing a version integer column and a created_at timestamp column. The current schema version of the database is defined as the version given in the row with the most recent created_at timestamp, or 0 if there are no rows in the table.

Place migrations in src/migrations. An empty migration example, 001_base_schema.clj, is provided.

See also for details on how Drift works.

Pull requests with enhancements are welcome. :)


Copyright © 2012 Paul Legato.

Distributed under the Eclipse Public License, the same as Clojure.

You can’t perform that action at this time.