Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google AppEngine String to Text

I have an entity field which were already saved in datastore as String. String in appengine have limit upto 500 characters.

How can I changed it to Text and making all old value still available?

like image 593
JR Galia Avatar asked Feb 04 '26 22:02

JR Galia


1 Answers

I recommend the following approach, especially if the code is in production:

  • Introduce a new Text field in your entity.
  • Write a simple migration code to go through each of your entities and then read the existing value from your String attribute and put that in the new Text attribute.
  • Modify current code to write and read only from the new Text attribute.

The above approach will help you do things step wise and in the worse case of things going wrong, atleast you have the old attribute and the old values as is.

like image 129
Romin Avatar answered Feb 06 '26 11:02

Romin