Advertisement

11.29.2007 at 10:52AM PST, ID: 22991380
[x]
Attachment Details

How to undo an incorrect rails migration after rake db:migrate

Asked by smetterd in Ruby Scripting Language, WebApplications

Tags: rails, undo, migration, rake

I forgot to put any code in the 'down' section. How do I undo a 'rake db:migrate'?

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
class User < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.column "username", :string
      t.column "fname", :string
      t.column "lname", :string
      t.column "email", :string
      t.column "hashed_password", :string
      t.column "campus_id", :integer
    end
  end
 
  def self.down
  end
end
[+][-]11.29.2007 at 11:49AM PST, ID: 20376647

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Ruby Scripting Language, WebApplications
Tags: rails, undo, migration, rake
Sign Up Now!
Solution Provided By: Wod
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628