Skip to content
Rails plugin for automating migrations http://errtheblog.com/posts/65-automatically
Ruby
Find file
Latest commit 59977d1 2 @pjhyett Merge pull request #2 from jtoy/master
I had to change this to get it to work on rails 3.

README

== AutoMigrations

Forget migrations, auto-migrate!


== Usage

Write out your schema (or use an existing one)

  $ cat db/schema.rb

  ActiveRecord::Schema.define do

    create_table :posts do |t|
      t.string   :title
      t.text     :body
      t.timestamps
    end
  
  end

  $ rake db:auto:migrate

  Created posts table

...a few days later

  $ cat db/schema.rb

  ActiveRecord::Schema.define do

    create_table :posts do |t|
      t.string   :title
      t.text     :content
      t.timestamps
    end
  
  end

  $ rake db:auto:migrate
  -- add_column("posts", :content, :text)
     -> 0.0307s
  -- remove_column("posts", "body")
     -> 0.0311s

* PJ Hyett [ pjhyett@gmail.com ]
Something went wrong with that request. Please try again.