When you change a field type web2py automatically creates tmp column
of the new type, copies data, delete the old column and renames the
tmp column. This works great if you convert, for example an int to
string. How well it works depends on the database and the type of
conversion.

If you want something that is more complex and the database does not
support it (for example a string field into a date field) than one
needs to write a script for it. The conversion may be done on the db
side or on the web2py side. The fact is there are a lot of options. I
am not sure how general rails migrations scripts are.

Massimo





On Jan 27, 8:05 pm, Thadeus Burgess <[email protected]> wrote:
> What about data type conversion though.
>
> In rails this is why you have to define migrations in rake script.
>
> Would it even be worth it for web2py ?
>
> Could we load the database column to a csv file, have web2py automate
> the drop column create column and new insert to the new data type?
>
> -Thadeus
>
> On Wed, Jan 27, 2010 at 7:44 PM, mdipierro <[email protected]> wrote:
> > problem is that changing a type is not always well defined. In
> > particular if you have data in the column the database may not be able
> > to convert the data from the old typ
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to