migration

[Work in progress] Database migrations for Crystal

Releases:

Dependencies:

Dependent shards (0)

Development dependencies:

Owner:

migration

A generic (database) migration tool for Crystal.

Features

  • Works both with pure SQL as well as ORMs.
  • Postgres, MySQL and Sqlite3 are supported out of the box.
  • When rolling out to several machines in parallel, it ensures that your migrations will only be performed on one of the running processes, while the other ones will wait for the migrations to finish.
  • Optionally, it exposes itself via command line arguments as part of your binary.
  • Allows introducing new backends (Redis, MongoDB, file system or anything else that you might want to migrate automatically) with ease.

TODO

  • [ ] rename db_uri to backend_uri
  • [ ] check what happens on migration-down after removing old migration files + ensure order
  • [ ] use all_subclasses instead of subclasses (?)
  • [ ] consider using up/down blocks instead of methods (?)
  • [ ] always exit on args (or default to true)
  • [ ] dump database automatically
  • [ ] create/drop database
  • [ ] mysql
  • [ ] sqlite3

Installation

Add this to your application's shard.yml:

dependencies:
  migration:
    github: lipanski/migration

Usage

require "migration"
Github statistic:
  • 0
  • 0
  • 1
  • 0
  • 6 months ago

License:

MIT License

Links: