johnRedden / TextbookProject

Textbook project start.
0 stars 0 forks source link

Structure Change: Add Order<integer> #37

Closed FelixVicis closed 8 years ago

FelixVicis commented 8 years ago

Change to structure: adding field Order to levels: Chapter, Section, Objective, Exercise

FelixVicis commented 8 years ago

Update

Found an issue that is relatively simple to fix. If your not able to get any of the json handlers without some large amount of issues, do these steps.

  1. Pull the latest version
  2. Deploy project
  3. run command ~$ gcloud preview datastore cleanup-indexes
  4. reply y to all of the prompts.
  5. All done!
johnRedden commented 8 years ago

This might be related... locally running app The API Catalogs returns 0 results... but in the Datastore Viewer there is one catalog. Do I need to clean up my local indexes? Where do I run that command? In the command prompt?

johnRedden commented 8 years ago

Ok, I can see my local catalogs... forgot to change the application:

application: ens-textbooksystem

Lost my chapters now...

johnRedden commented 8 years ago

Ok, if an old datastore entity does not have Order field the api will not return it. How to fix? How to add Order field to old entities?

johnRedden commented 8 years ago

Ugh: https://cloud.google.com/appengine/articles/update_schema#before-we-start

FelixVicis commented 8 years ago

You said that the information you had was not worth the effort of updating for this change. I otherwise would've recommended you export your book(s) before pulling so that they would get the new structure on import.

johnRedden commented 8 years ago

Yes, my local datastore is not worth saving but the work on the deployed version is worth saving. Especially the objectives. Not a complete waste if lost... but I think learning how to deal with this issue is worth it because fields might be added in the future. I did not think adding fields would break it?

What would be the streamlined procedure for saving this objective work?

http://www.ens-textbooksystem.appspot.com/toc/5688424874901504

Remember that images are prefixed with the objective ID.

FelixVicis commented 8 years ago

First export all the books that you want to save Next update your exported version deleting all of the data store entries Next import the saved books Finally replace the images for the objectives and exercises with the images from the complete saved book On May 29, 2016 12:50 PM, "John Redden" notifications@github.com wrote:

Yes, my local datastore is not worth saving but the work on the deployed version is worth saving. Especially the objectives. Not a complete waste if lost... but I think learning how to deal with this issue is worth it because fields might be added in the future. I did not think adding fields would break it?

What would be the streamlined procedure for saving this objective work?

http://www.ens-textbooksystem.appspot.com/toc/5688424874901504

Remember that images are prefixed with the objective ID.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/johnRedden/TextbookProject/issues/37#issuecomment-222379149, or mute the thread https://github.com/notifications/unsubscribe/AGRnfpF2RVhjzAYFEoM2OYHCByriEw8uks5qGe3pgaJpZM4IpKAS .

FelixVicis commented 8 years ago

Your Datastore and You!

A guide to fixing major errors.


When updating your datastore with entity changes, there are really only two options for such an occasion.

  1. Programmatically update your entities This can be accomplished in many ways: scripts, exporting, ect. But those are topics for another discussion.
  2. Manually edit your datastore

    This will be the primary purpose of the guide. Editing the entities is a time consuming job but a very thorough one as well. What you gain by doing this very difficult job is the maintenance of semantic links; no need to worry about broken references, they never changed!

At the beginning of this guide, we assume that you have already backed up your information.

Step 1: Verify your model.

This initial step is very important, as the work you will be doing is very time consuming it is important that you know exactly what is to be changed. step one_ensure model is correct

Step 2: Add Missing Fields

Upon fining a field missing for your entities, fill this missing information in with valid information. This could be nil for a string, zero for an integer, ect. The important part is that there is no longer a missing key. step 2_add missing fields

Step 2.5: Rinse and Repeat

For every entity of every kind that need information do this action. This is the slow part of the job. step 2 5 keep doing these actions until all of these dashes are gone

Step 3: Update, Deployment, Indexes

Now that your information is valid again, it is time for you to pull your latest development version, deploy again to the app you just updated and then check your indexes. All indexes in your project must be labeled with a green arrow as 'serving' otherwise that query will not function. step 4 deploy and check indexes

Step 4: Complete

Your project is back on task and ready to roll.

johnRedden commented 8 years ago

:+1: Maybe link to this in the docs.