github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

pjhyett / auto_migrations

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 95
    • 11
  • Source
  • Commits
  • Network (11)
  • Issues (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Rails plugin for automating migrations — Read more

  cancel

http://errtheblog.com/posts/65-automatically

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

add support of primary_key option 
Zhang Yuanyi (author)
Fri Oct 09 06:56:17 -0700 2009
pjhyett (committer)
Fri Oct 09 16:09:16 -0700 2009
commit  29592a2a17d3195308e66bd339fc35b850511fe4
tree    5c3f85f2db1a516e34ef9c2a88b8fad15bb0fb5c
parent  d53bacb3b2e8e20392ac55255b4719db7d7b6dbf
auto_migrations /
name age
history
message
file MIT-LICENSE Sat Mar 15 17:44:02 -0700 2008 migrate automatically [pjhyett]
file README Mon Apr 20 17:19:37 -0700 2009 use github's issue tracker [pjhyett]
file Rakefile Sat Mar 15 17:44:02 -0700 2008 migrate automatically [pjhyett]
file init.rb Sat Mar 15 17:44:02 -0700 2008 migrate automatically [pjhyett]
directory lib/ Fri Oct 09 16:09:16 -0700 2009 add support of primary_key option [Zhang Yuanyi]
directory tasks/ Mon Feb 16 12:06:40 -0800 2009 Added the ability to reset schema migrations ta... [mlightner]
directory test/ Sat Mar 15 17:44:02 -0700 2008 migrate automatically [pjhyett]
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 ]
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server