Hi,
Getting this error and hope someone can point me in the direction to
solve it:
== AddPriceToProduct: migrating
– add_column(:products, :price, :decimal, {:precision=>8, :scale=>2,
:default=>0})
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: no such table: products: ALTER TABLE “products”
ADD “price” decimal(8,2) DEFAULT 0
I’m using the Agile Web D. with Rails P1.0 book and after I
input this:
ruby script/generate migration add_price_to_product price:decimal
all seemed ok. I then modified the xxx_add_price_to_product.rb file as
specified in the book and when I tried the rake db:migrate, it throws
that exception.
The problem is, I used the SQLite Browser on my Ubuntu 9.10 box and it
shows the table exists in the development.sqlite3 database. I’m
stumped…
Thanks in advance for any help,
SS
Hi all,
Not sure what really did it but solved it, here it is for future
reference. Since I’ve been using a few different machines over the past
hour, not sure where I got the different steps from, if anyone knows,
please post credit.
-
Installed sqlite3-ruby gem using sudo gem install sqlite3-ruby. Not
sure how/why this did anything since the table was created on the
set/generate earlier.
-
Stopped Webrick and restarted.
That’s all, really uncertain why this worked…and yes, I do believe in
magic!
Sheridan Sheridan wrote:
Hi,
Getting this error and hope someone can point me in the direction to
solve it:
== AddPriceToProduct: migrating
– add_column(:products, :price, :decimal, {:precision=>8, :scale=>2,
:default=>0})
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: no such table: products: ALTER TABLE “products”
ADD “price” decimal(8,2) DEFAULT 0
I’m using the Agile Web D. with Rails P1.0 book and after I
input this:
ruby script/generate migration add_price_to_product price:decimal
all seemed ok. I then modified the xxx_add_price_to_product.rb file as
specified in the book and when I tried the rake db:migrate, it throws
that exception.
The problem is, I used the SQLite Browser on my Ubuntu 9.10 box and it
shows the table exists in the development.sqlite3 database. I’m
stumped…
Thanks in advance for any help,
SS