can you try Field('description', 'text', length = 2048),
On Wednesday, 7 March 2012 15:48:51 UTC-6, David Phillips wrote:
>
> I have an App Engine web app in production. I defined a field in a
> database table as a string with no length.
>
> Field('description'),
>
> Now I find that the field needs to handle 2,000 characters. That means
> that the field needs to be changed in the Datastore entity from a
> ByteString type to a Blob type. I don't,however, want to accidentally
> delete data, and I'm unsure how to safely convert the field to handle
> a 2K string.
>
> I did try one thing. I changed the field to
>
> Field('description', length = 2048),
>
> When I deployed the new code, the field remained a string and an
> attempt to store more than 500 characters caused an exception.
>
> So is there any way to migrate the existing string field to a blob?
> And if so, how would one go about it?
>
> By the way, there was already a bit of a mismatch. The default string
> field in the DAL is supposed to be 512 bytes. When deployed on
> appengine, that causes the creation of a ByteString which has a
> maximum size of 500 characters.