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
- Host: GitHub
- URL: https://github.com/cldwalker/migration_sql
- Owner: cldwalker
- License: mit
- Created: 2012-07-05T18:34:00.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-07-09T15:35:46.000Z (almost 14 years ago)
- Last Synced: 2025-03-20T10:44:15.694Z (about 1 year ago)
- Language: Ruby
- Size: 89.8 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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