migrate.cr
A crystal library that can be used to create/drop/migrate/rollback your database
Installation
Add this to your application's shard.yml
:
dependencies:
migrate.cr:
github: paulcsmith/migrate.cr
Creating, dropping and migrating the database
This library consists of various tasks that can be run from the command line.
crystal lib/migrate.cr/tasks/db/create.cr name_of_db
crystal lib/migrate.cr/tasks/db/drop.cr name_of_db
crystal lib/migrate.cr/tasks/db/migrate.cr name_of_db
crystal lib/migrate.cr/tasks/db/rollback.cr name_of_db
crystal lib/migrate.cr/tasks/db/rollback_all.cr name_of_db
Generating a migration
crystal lib/migrate.cr/tasks/gen/migration.cr CreateUsers
This will create a timestamped migration in db/migrations
Contributing
- Fork it ( https://github.com/paulcsmith/migrate.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- paulcsmith Paul Smith - creator, maintainer