Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7634847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:17:14+00:00 2026-05-31T07:17:14+00:00

I have a persistent class stored in a GAE datastore. I have removed one

  • 0

I have a persistent class stored in a GAE datastore. I have removed one of the attributes from the class. The new records in this table show a value <none> for the removed attribute. But is there a way I can completely drop this column off the table?

Thanks.

Added the following ‘migration’ code according to moraes’ suggestion, but it isn’t achieving the desired result:

PersistenceManager pm = PMF.get().getPersistenceManager();
try {
    Query q = pm.newQuery(UserLogin.class);
    Collection<UserLogin> list = (Collection<UserLogin>) q.execute();

    Iterator<UserLogin> iter = list.iterator();
    while (iter.hasNext()) {
        UserLogin obj = (UserLogin) iter.next();
        obj.setLoginDate(obj.getLoginDate());
    }

    pm.makePersistentAll(list); 

} finally {
    pm.close();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:17:15+00:00Added an answer on May 31, 2026 at 7:17 am

    I found the answer to this problem in this Article:
    http://code.google.com/appengine/articles/update_schema.html

    “Removing Deleted Properties from the Datastore

    If you remove a property from your model, you will find that existing entities still have the property. It will still be shown in the admin console and will still be present in the datastore. To really clean out the old data, you need to cycle through your entities and remove the data from each one.

    • Make sure you have removed the properties from the model definition.

    • If your model class inherits from db.Model, temporarily switch it to inherit from db.Expando. (db.Model instances can’t be modified dynamically, which is what we need to do in the next step.)

    • Cycle through existing entities (like described above). For each entity, use delattr to delete the obsolete property and then save the entity.

    • If your model originally inherited from db.Model, don’t forget to change it back after updating all the data.”

    And here is an example with code:
    http://sandrylogan.wordpress.com/2010/12/08/delattr/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a persistent class Author with two fields: int id , String name
I am using the SQLite database and have the following persistent class (simplified): public
I have a PersistenceCapable class @PersistenceCapable(identityType = IdentityType.APPLICATION) public class MyClass { @PrimaryKey @Persistent(valueStrategy
is it possible in Db4o to load new objects into persistent IObjectContainer? I have
I have this entity class, called Pagina and I want to update the entry
I have a class in Django that is stored in the utils directory. I
I have just one week experience in GAE/Java and trying to port an legacy
I have a class for each database table object. Each class takes care of
I'm using a SQLite persistent store. I have a NSManagedObject class Den with a
How can I copy an NSManagedObject from one NSManagedObjectContext to another? I have 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.