https://github.com/swlkr/trek
Easy database migrations for clojure
https://github.com/swlkr/trek
clojure database migrations
Last synced: 10 months ago
JSON representation
Easy database migrations for clojure
- Host: GitHub
- URL: https://github.com/swlkr/trek
- Owner: swlkr
- Created: 2017-11-02T04:20:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T05:01:19.000Z (about 8 years ago)
- Last Synced: 2025-01-15T10:08:18.100Z (12 months ago)
- Topics: clojure, database, migrations
- Language: Clojure
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# trek
Easy database migrations for clojure
## Usage
Migrations look like this
```sql
-- up
create table posts (
id serial primary key,
title text not null,
body text not null,
created_at timestamp
)
-- down
drop table posts
```
Migrations live in resources/migrations
There is no lein plugin but you could use aliases with
the functions below:
```clojure
(migrate db-spec) ; applies all pending migrations in order
(rollback db-spec) ; rolls one migration back
(create "create-users" "email:text" "password:text") ; creates a migration file in resources/migrations
```