Re: Beginning Ruby on Rails E-Commerce : Errata Help

John Ivanoff
2006-11-21T17:21:33Z

my migration just worked.
i''m running Locomotive 2.0.8
(http://locomotive.raaum.org/bundles/index.html)
I followed what''s in the book.

$ script/generate migration add_book_cover_column

-------------------------------

class AddBookCoverColumn < ActiveRecord::Migration
  def self.up
    add_column :books, :cover_image, :string
  end

  def self.down
    remove_column :books, :cover_image
  end
end

-----------

$ rake migrate
(in /Users/johnivanoff/Sites/emporium)
== AddBookCoverColumn: migrating =============================================--
add_column(:books, :cover_image, :string)
   -> 0.0745s
== AddBookCoverColumn: migrated (0.0747s) ====================================
Loaded suite
/Applications/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/bin/rake
Started

Finished in 0.000254 seconds.

0 tests, 0 assertions, 0 failures, 0 errors
---------------------------------------------------------------------------------------------

On 11/20/06, Holly Thomas
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> Page 103, the migration for adding the cover column does not seem to
> work.
>
> $ script/generate migration add_book_cover_column
>
> class AddBookCoverColumn < ActiveRecord::Migration
> def self.up
> add_column :books, :cover_image, :string
> end
> def self.down
> remove_column :books, :cover_image
> end
> end
>
> When I do the "rake migrate", I get table books already exists
error
> message.
> Can someone tell me how to get this to work? TIA.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >