Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails plugin to generate SQL files from migrations

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.rdoc

Migration SQL Generator

This is a Rails plugin to generate SQL from migrations.

It achieves this by monkey patching the definitions of ActiveRecord::Base.connection.execute and other related methods.

It has only been tested with the sqlserver and mysql adapters (see limitations). If you test it with another adapter and it works, please let me know!

Installation

rails plugin install git://github.com/plentz/migration_sql_generator.git

Usage

rake db:generate:migration_sql

Known limits

  • May fail on migrations that perform CRUD via ActiveRecord methods

  • With the mysql and oracle adapter, fails on change_column, rename_column

  • Fails on redhillonrails_core plugin with the mysql adapter

Credits

  • Muness Alrubaie, Relevance Inc.

Shout out to Jay Fields for the original code this plugin grew out of: blog.jayfields.com/2006/11/rails-generate-sql-from-migrations.html

License

Copyright Relevance, Inc. 2009

You may use, copy and redistribute this library under the MIT license.

Something went wrong with that request. Please try again.