Displaying 6 results from an estimated 6 matches for "002_add_price".
2006 Aug 04
8
Demo in rails2.pdf of add_price migration, PostgreSQL 8.1.4
People,
I''m looking at the migrate example on p 74 of the rails2.pdf
It''s a simple example of using a migration to add a column to
the products table.
Here is a copy of the migration file named 002_add_price.rb
after I generated and then edited it:
class AddPrice < ActiveRecord::Migration
def self.up
add_column :products, :price, :decimal, :precision => 8, :scale => 2,
:default => 0
end
def self.down
remove_column :products, :price
end
end
I see this error when I walk th...
2006 Aug 01
10
Migration DB Question
Just going through ''agile web development with rails'' 2nd ed.
I accidentally created an empty migration source file with the wrong
name,
ruby script/generate migration add_test_date
and then straight after that created the one I wanted to use
ruby script/generate migration add_test_data
and populated the second one - when I ran
rake db:migrate
a few times it did not seem
2006 Aug 16
6
Newbie-Question
...b/ruby/1.8/benchmark.rb:293:in `measure''
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:257:in `say_with_time''
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:271:in `method_missing''
./db/migrate//002_add_price.rb:3:in `real_up''
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:210:in `migrate''
d:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure''
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r
b:210:in `migrate...
2006 Nov 16
4
rake db:migrate problem
.../ruby/1.8/benchmark.rb:293:in `measure''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:257:in
`say_with_time''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:271:in
`method_missing''
./db/migrate//002_add_price.rb:8:in `real_up''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in
`send''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:210:in
`migrate''
/opt/local/lib/ruby/1.8/benchmark.rb:293:in `measur...
2007 Jan 21
6
rake db:migrate "undefined method `default'" error
...'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:259:in
`say_with_time''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:273:in
`method_missing''
./db/migrate//002_add_price.rb:3:in `real_up''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:212:in
`migrate''
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/migration.rb:212:in
`migrate''
/usr/...
2006 Jun 06
15
error working through Agile !!!
Hi everyone,
I''m working my way thru the ''Depot'' project from Agile Web Development
with Rails.
I got to the bit where I type:
ruby script/generate scaffold Product admin
And I get the following error:
error Before updating scaffolding from new DB schema, try creating a
table for your model (Product) ( on the last line ! )
Now I have followed everything as