rubyonrailsin

A Ruby and Rails talk

Thursday, April 1, 2010


[spree-user] Re: Inventory and Line_Items tables, how are they used

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

As a newb I feel like I miss obvious things all the time.

So here is the issue I have, the overview_dashboard is looking for a
very old Variant that was deleted awhile back but it was test ordered
a bunch so the dashboard looks at it and thinks it should be there.

The Variant id still lives in both the Inventory_units and Line_items
tables. the question is can I remove items from those tables without
hurting anything else.

My fear is that I delete, one thing, and it will raise another issue,
so I fix that one and it raises a new one.

The fix in my head is do something like
Line_Item.delete_all(:conditions => older than the launch date)
Inventory_Unit.delete_all(:conditions => variant_id == 'id related to
the error I am getting.')

will this cause a problem some where else that anyone knows of?

thanks

On Apr 1, 8:23 am, Morgan Christiansson <google....@mog.se> wrote:
> How did you miss this message in config/database.yml ?
>
> # Warning: The database defined as 'test' will be erased and
> # re-generated from your development database when you run 'rake'.
> # Do not set this db to the same as development or production.
>
> Your .delete_all look fine, although I haven't used spree much myself.
> Just as long as you're not deleting anything that's in use you'll be
> fine. If you're worried you could create a backup first?
>
> A lot can be learned from breaking stuff ;-)
>
> /Morgan
>
> On Mar 31, 4:18 pm, ravenna <t...@ravennainteractive.com> wrote:
>
> > I am pretty new to rails and just wrapped up my first Spree store
> > using 0.8.4.  Just as I thought I was done I discovered an issue.  I
> > did not have a test db so the site was beta tested using the
> > production db.  I know this was a mistake, and a bad call on my
> > part.
>
> > Anyway, now the problem I have is that using the production db and the
> > overview_dashboard has data in it that I don't need.  I cleared out
> > old orders but there are records of old variants in the
> > Inventory_units and Line_Itemtables.  Is there any reason no to
> > delete the old records that I don't need?  If I delete these db items
> > will there be othertablesaffected?
>
> > One of the things I might do is (still learning the right code for it)
> > script/console > Line_items.delete_all( older than the launch date).
> > Not sure the same idea applies to the Inventory_Units table.  Any
> > ideas?
>
> > thanks so much for any help you can give.

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive