Skip to content

Instantly share code, notes, and snippets.

# Generate a new schema from a legacy database from a generated hash map
# code released courtesy of Radio New Zealand under MIT license
# see http://www.abletech.co.nz/2009/06/rails-legacy-database-migration/ for more info
desc "generates migration code insert"
task :generate_migrations_sniplet => :environment do
s = "MIGRATIONS = \n"
s << " [\n"
con = ActiveRecord::Base.connection
con.tables.each do |table|