Forum: Ruby on Rails Changing a column name with migration failed

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
RichardOnRails (Guest)
on 2008-12-20 05:52
(Received via mailing list)
Hi All,

I had a column-name "changed" that I wanted to replaced with

I tried:
class ModifyChangedAttribute < ActiveRecord::Migration
  def self.up
    rename_column(:csvs, :created, :accessed)

  def self.down
    rename_column(:csvs, :accessed, :created)

The migration failed:
1. It was apparent because rake db/migrate returned only one line
indicating the app's "home"
2. Sqlite3's .dump table_name showed that "created" was unchanged.

I see now that I provided no table_name to the migration.  How do I do

I'm running:
ruby 1.8.6
Rails 2.2.1

Thanks in Advance,
RichardOnRails (Guest)
on 2008-12-20 06:01
(Received via mailing list)
BTW,  I put up all the code on


On Dec 19, 10:51 pm, RichardOnRails
RichardOnRails (Guest)
on 2008-12-20 06:15
(Received via mailing list)
My earlier statement, "I don't have a column name" is incorrect.

The statement:
rename_column(:csvs, :created, :accessed)
provided the table_name "cvs" as symbol,  the old_name "created" as a
symbol, and the new_name.

So I don't have a clue as to what's wrong.  All the code is on, as I mentioned before.

Again, thanks for any insights you may offer,

On Dec 19, 11:01 pm, RichardOnRails
This topic is locked and can not be replied to.