Generates the sql equivalent of db/migrate into db/migration_sql. Currently only works for Rails apps and Sequel.
If using bundler, add this line to your application's Gemfile:
Or install it yourself with:
$ gem install migration_sql
To dump your migration sql, use this rake task:
$ rake db:dump_migration_sql Saved sql for 20120605163256_add_some_column.rb ...
The rake task runs on your test environment and assumes db:drop and db:create for dropping
and creating your database. Additional db create tasks can be configured with
MigrationSql.db_create_tasks. The rake task can be run multiple times and will only create
sql files that don't already exist.
- Write tests!
- Consider adding ActiveRecord support using migration_sql_generator
MIT. See LICENSE for more.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request