An open API service indexing awesome lists of open source software.

https://github.com/cldwalker/migration_sql

Generate migration sql for Rails apps and Sequel
https://github.com/cldwalker/migration_sql

Last synced: about 1 month ago
JSON representation

Generate migration sql for Rails apps and Sequel

Awesome Lists containing this project

README

          

# Description

Generates the sql equivalent of db/migrate into db/migration\_sql. Currently only works for Rails apps and Sequel.

## Installation

If using bundler, add this line to your application's Gemfile:

gem 'migration_sql'

Or install it yourself with:

$ gem install migration_sql

## Usage

To dump your migration sql, use this rake task:
```sh
$ 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.

## TODO
* Write tests!
* Consider adding ActiveRecord support using
[migration_sql_generator](https://github.com/muness/migration_sql_generator)

## License

MIT. See LICENSE for more.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request