Skip to content

Commit

Permalink
update readme and add screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jan 19, 2024
1 parent 212c871 commit cdd053f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
54 changes: 51 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,69 @@ REF: a small penguin with a yellowish crest, breeding on subantarctic coastal cl

- Embeddable migration script - you can embed SQL files as go source files and compile them into a binary
- Support multiple drivers
- Goose compatible
- Modularized migration package structure
- Goose <https://github.com/pressly/goose> compatible

# Supported Drivers

- mysql
- sqlite3
- mssql
- postgresql
- mssql

# Install

```
go get github.com/c9s/rockhopper/cmd/rockhopper
go install github.com/c9s/rockhopper/cmd/rockhopper@latest
```

# Quick Start

Add `rockhopper.yaml` with the following content:

```sh
---
driver: mysql
dialect: mysql
dsn: "root@tcp(localhost:3306)/rockhopper?parseTime=true"
package: myapp
migrationsDirs:
- migrations/module1
- migrations/module2
```

And create the directory structure for your migration files (or you can just use `migrations/`:

```sh
mkdir -p migrations/{module1,module2}
```

Then create a migration file with the following command:

```sh
rockhopper create -t sql --output migrations/module1 add_trades_table
```

Now you can check your migration status:

```sh
rockhopper status
```

To upgrade:

```shell
rockhopper up
```

To downgrade:

```shell
rockhopper down
```



# Usage

Create a directory for your migrations:
Expand Down
Binary file added screenshots/screenshot1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cdd053f

Please sign in to comment.