https://github.com/tmattio/omigrate
Database migrations for Reason and OCaml
https://github.com/tmattio/omigrate
Last synced: 10 months ago
JSON representation
Database migrations for Reason and OCaml
- Host: GitHub
- URL: https://github.com/tmattio/omigrate
- Owner: tmattio
- License: mit
- Created: 2020-05-24T18:24:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-15T14:26:54.000Z (about 3 years ago)
- Last Synced: 2025-03-20T16:16:39.847Z (10 months ago)
- Language: OCaml
- Size: 78.1 KB
- Stars: 32
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - omigrate
README
# OCaml Migrate
[](https://github.com/tmattio/omigrate/actions)
Database migrations for Reason and OCaml
## Drivers
- PosgreSQL (`omigrate.postgres`)
- Sqlite3 (`omigrate.sqlite3`)
## Installation
### Using Opam
```bash
opam install omigrate
```
### Using Esy
```bash
esy add @opam/omigrate
```
## Usage
### `omigrate create --dir DIR NAME`
Create a new migration and prepend it with a timestamp.
### `omigrate ls --source SOURCE --database DATABASE`
List the migrations with their state.
### `omigrate up --source SOURCE --database DATABASE`
Apply all up migrations.
### `omigrate down --source SOURCE --database DATABASE`
Apply all down migrations.
### `omigrate setup --source SOURCE --database DATABASE`
Setup the database and run all the migrations.
### `omigrate drop --database DATABASE`
Delete the database.
## Examples
The [example](example/README.md) provides some migrations available to test `omigrate` with the different drivers.
## Contributing
Take a look at our [Contributing Guide](CONTRIBUTING.md).