For completeness and future reference this can also be done directly in SQL
for example in postgresql:
UPDATE your_table set some_field = '|' || some_field || '|';
On Tuesday, January 14, 2014 8:52:40 AM UTC-5, Anthony wrote:
> For now, if you want to do a migration, all you have to do is loop through
> the records and put a pipe character ("|") before and after each string.
> Perhaps this can be automated -- you can submit an issue on Google Code.
>
> Anthony
>
> On Tuesday, January 14, 2014 1:21:52 AM UTC-5, User wrote:
>>
>> It appears it will leave the string data that exists in the string field
>> alone in the database, however web2py will interpret it such that the first
>> and last character are truncated. For example:
>>
>> "hello" -> "ell"
>>
>> "something" -> "omethin"
>>
>> "world" -> "orl"
>> As soon as you add another list item to the string, then web2py
>> will overwrite the original string's first and last characters with pipe
>> characters in the database in addition to adding the new item.
>>
>> Migration back from list:string to string will preserve whatever
>> list:string data is there (in the web2py representation format).
>>
>> "hello", "world" -> "|hello|world|"
>>
>> "one", "two" -> "|one|two|"
>>
>> Would it make sense for the migration process to handle this more
>> gracefully?
>>
>>
>> On Monday, January 13, 2014 3:34:47 PM UTC-5, User wrote:
>>
>>> Does a migration from a 'string' field to a 'list:string' field preserve
>>> string data that is already in the database and convert it to the format
>>> required by list:string?
>>>
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.