[web2py] Re: web2py DAL, migration

2012-06-25 Thread aungsan
Hey 

thanks you so much. I guess it is mysql wired thing. keyword reserve. But 
sometimes it does work. sometimes it does not.  ^_^

-- 





[web2py] Re: web2py DAL, migration

2012-06-25 Thread Massimo Di Pierro
You cannot change a field name. Changing a field name will be interpreted 
as the previous field being deleted and a new field with the new name bing 
created.

In your case this worked when you replace change with chnage. 

When you changed it back to change it should have worked too. What error 
did you get exactly?

massimo

On Monday, 25 June 2012 16:46:34 UTC-5, aungsan wrote:
>
> Hi,
>
> I got web2py dal very wired problem.
>
> I follow that link.
>
> http://vimeo.com/23145118
>
> db.define_table('stock_price2',
>   Field('symbol'),
>   Field('price', 'double'),
>   Field('price_change', 'double'),
> )
>
> Accidentally, i type chnage in the last field name. So I want to change it 
> back to "change". MySQL  does not accept that field name. And then later 
> web2py give me no much problem Cos I go and change directly in mysql.
>
> db.define_table('stock_price2',
>   Field('symbol'),
>   Field('price', 'double'),
>   Field('price_change', 'double'),
>   migrate = False, fake_migrate = True
> )
>
> Nothing work.
>
> I really want to know simple example how to change field name after table 
> is crated.
>
> Thanks you very much. Web2py ROCK !
>

--