Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8148845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:43:34+00:00 2026-06-06T14:43:34+00:00

I was wondering what those meant: class ChangeTimeColumns < ActiveRecord::Migration def self.up end def

  • 0

I was wondering what those meant:

class ChangeTimeColumns < ActiveRecord::Migration
  def self.up
  end

  def self.down
  end
end

as sometimes Rails just creates a migration like this:

class ChangeTimeColumns < ActiveRecord::Migration
  def change
  end
end

Would appreciate any clarification.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:43:35+00:00Added an answer on June 6, 2026 at 2:43 pm

    It is so you can reverse the migration if you have made a mistake.

    rake db:rollback   #this will rollback the most recent migration
    
    
    rake db:rollback STEP=3  #this will rollback 3 of them
    

    I add self.up and self.down to all my migrations, and if there is a migration that is not possible to reverse, you can not include down or raise an exception in down. Check out section 4.1 in this guide ====> http://guides.rubyonrails.org/migrations.html#using-the-up-down-methods

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails model class class Model < ActiveRecord::Base has_many :object_collection def add_object(object)
Just wondering if these are improper ways of using LINQ. They work, just don't
Was just wondering how do these sites (and many other softwares that generate flash
I am wondering when to use static methods? Say if I have a class
I`ve been wondering how to implement methods in a class. Could someone explain me
I'm wondering what is the difference for application between those two calls, in means
I bumbed into one of those moments when I just lose the focus and
I was just wondering if there is a shortcut to do something like this
For a while we were using a tool called CodeVeil. I'm just wondering if
I'm wondering if these two expressions are equivalent, because if they are, it would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.