Re: [web2py] Migrate integer field to string type

2016-10-26 Thread Richard Vézina
Yes is you do it within the shell you better commit every 100 records depending of the size of the record, but since it just a single column and integer you can commit even every 500-1000 records I guess without issue... To do so you can use this snippet : for i, r in enumerate(db.select()):

Re: [web2py] Migrate integer field to string type

2016-10-25 Thread Dave S
On Tuesday, October 25, 2016 at 8:08:28 AM UTC-7, Ian W. Scott wrote: > > Okay, that's what I was afraid of. Thanks. > > Ian > > On Tuesday, October 25, 2016 at 10:06:19 AM UTC-4, Richard wrote: >> >> You can't just change the field type, you have to create another column >> of string type then

Re: [web2py] Migrate integer field to string type

2016-10-25 Thread Ian W. Scott
Okay, that's what I was afraid of. Thanks. Ian On Tuesday, October 25, 2016 at 10:06:19 AM UTC-4, Richard wrote: > > You can't just change the field type, you have to create another column of > string type then insert your data from a select of the other column into it > then delete the old use

Re: [web2py] Migrate integer field to string type

2016-10-25 Thread Richard Vézina
You can't just change the field type, you have to create another column of string type then insert your data from a select of the other column into it then delete the old useless column... You need to transform the integer into text at the insert step... Richard On Mon, Oct 24, 2016 at 3:32 PM, I

[web2py] Migrate integer field to string type

2016-10-24 Thread Ian W. Scott
I'm using Postgresql and I need to migrate the data type of a field from "integer" to "string". Will it work to just change the field type in the model table definition? What will happen to the existing "integer" data? Any problems foreseen? Thanks, Ian -- Resources: - http://web2py.com - ht