Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/relrod/dbm
A *simple* database migration tool.
https://github.com/relrod/dbm
Last synced: 13 days ago
JSON representation
A *simple* database migration tool.
- Host: GitHub
- URL: https://github.com/relrod/dbm
- Owner: relrod
- License: bsd-3-clause
- Created: 2016-08-17T05:19:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T23:15:53.000Z (about 8 years ago)
- Last Synced: 2024-04-25T23:31:20.844Z (6 months ago)
- Language: Haskell
- Size: 14.6 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dbm
A **simple** database migration tool.
## Philosophy
The idea here is to create the simplest, stupidest, dumbest thing that could
possibly work.`dbm` is made to sit outside of other projects - it's not tied to any framework
and although it's written in Haskell it can certainly be used with projects in
other environments.To use it, simply create a `sql/` directory in your project's root directory,
with your migrations. Name the migrations `###-some-short-description.sql`. e.g.
`001.initial-schema.sql`.Then create a file, `sql/.dbm`, that describes how to access your database in
certain environments.For example
```ini
[development]
backend = sqlite
path = /tmp/inventory.sql
```That's it! Now you can run `dbm initialize ` which will add a
simple table to your database to keep track of migration data. See `dbm -h` for
a full list of commands, but briefly:* `dbm initialize ` will create the `dbm_migrations` table in your
database for keeping track of migration status.
* `dbm status ` will show you which migrations need to be applied, if any.
* `dbm migrate ` will migrate your database to the latest migration.## What works, what doesn't?
* There is no notation of "undoing" a migration. This is by design to keep
things simple, although if it is something you need, open an issue. :)
* Right now, only SQLite is supported, but it should be easy to add other
backends. We use the `$database-simple` Hackage packages, so in theory adding
at least MySQL and PostgreSQL should be near-trivial.## License
BSD-3, see `LICENSE`.