Unknown column 'variation_rank'

7 views
Skip to first unread message

Sean

unread,
Sep 18, 2010, 3:53:42 PM9/18/10
to substruct
Got everything installed and running - able to log into the admin and
add a product -- but when editing a product and I click View on the
site I'm getting the following exception

ActiveRecord::StatementInvalid in Store#index

Showing vendor/plugins/substruct/app/views/store/_product.rhtml where
line #25 raised:

Mysql::Error: Unknown column 'variation_rank' in 'order clause':
SELECT * FROM `items` WHERE (`items`.product_id = 1) AND
( (`items`.`type` = 'Variation' ) ) ORDER BY price ASC, -
variation_rank DESC
Extracted source (around line #25):

22: <div class="product_title">
23: <%=
link_to(product.name, :controller=>'store', :action=>'show', :id =>
product.code) %>
24: </div>
25: <% if product.display_price? %>
26: <span class="money"><%=
sub_number_to_currency(product.display_price) %></span>
27: <% end %>
28: </div>

subimage

unread,
Sep 18, 2010, 4:10:55 PM9/18/10
to substruct

Sean

unread,
Sep 19, 2010, 10:30:00 AM9/19/10
to substruct
I am pretty much brand new to ROR and have more of a .NET MVC
background -- I got the latest SVN and that seemed to fix my problem
however I have a question -- When this happens in the future won't I
be erasing all of the data from my database in order to update? -- I
guess my question is when I run the bootstrap or the migrations is my
data just erased?

On Sep 18, 4:10 pm, subimage <subim...@gmail.com> wrote:
> Sean - see this issue.
>
> Thanks.
>
> http://code.google.com/p/substruct/issues/detail?id=223&can=1&q=varia...

Roger Pack

unread,
Sep 20, 2010, 11:59:06 AM9/20/10
to subs...@googlegroups.com
update? -- I
> guess my question is when I run the bootstrap or the migrations is my
> data just erased?

migrations just apply "any new migrations that haven't been applied
yet" (so the answer is: no, but yes if a new migration happens to be
one that erases data, for example by dropping a table).

Reply all
Reply to author
Forward
0 new messages