How can I delete a column from my table?

195 views
Skip to first unread message

Daniel

unread,
Mar 11, 2011, 6:56:31 AM3/11/11
to objectify-appengine
I'm using the objectify in my project...

In my class i had Double variable that i don't need any more, so I've
deleted it from the class...


How can i delete from the data store either?

I asked in app engine group, but didn't understand...

Is there a way i can do it with objectify?


Thanks ahead,


Daniel

Thomas Visser

unread,
Mar 11, 2011, 8:00:03 AM3/11/11
to objectify-appengine
There is no such thing as a table in the data store. There is no such
thing as a table structure either. All you can do is loop over all the
entities of the type you want to modify and set the property to null.

Jeff Schnitzer

unread,
Mar 11, 2011, 8:03:31 PM3/11/11
to objectify...@googlegroups.com
Just to make it a tiny bit more clear... if you delete the field from
your entity POJO, the next time you save the entity the new data (sans
field) will overwrite the old data.

Unless you're talking about very large quantities of data, you should
probably just ignore old fields - they'll get purged as your data
churns normally. And if you do want to delete the data explicitly,
you will need to balance the expensive of rewriting all that data with
the expense of just letting it sit and paying the extra monthly fee
for data. Chances are that for a Double there's not much point. For
200k blobs it would probably be worth it.

Jeff

Daniel

unread,
Mar 12, 2011, 9:59:59 AM3/12/11
to objectify-appengine
I did a loop over all the entities , and set null in the property....

but the column still remains... its just full of <null> ....

How can i remove it entirely? I don't wanna see it at all...?

Jeff Schnitzer

unread,
Mar 12, 2011, 2:42:52 PM3/12/11
to objectify...@googlegroups.com
Just remove the field from your entity POJO. Then load/save the entity.

Jeff

Daniel

unread,
Mar 12, 2011, 5:10:41 PM3/12/11
to objectify-appengine
finally :)

big thanks!

On Mar 12, 9:42 pm, Jeff Schnitzer <j...@infohazard.org> wrote:
> Just remove the field from your entity POJO.  Then load/save the entity.
>
> Jeff
>
Reply all
Reply to author
Forward
0 new messages