Yes. this is wrong:

Field('City', db.city, 'list:reference city', label='Miestas'),

should be

Field('City', 'list:reference city', label='Miestas'),

On Wednesday, 1 August 2012 09:15:07 UTC-5, Aurelijus Useckas wrote:
>
> Thank you Massimo, but the 1005/150 mysql problem seems to be smth wring 
> with foreign key (merging of tables). Are there any flaws in my DAL syntax? 
>
> This line seems to be the trigger:
> Field('City', db.city, 'list:reference city', label='Miestas'),
>
> it references:
>
> db.define_table('city',
>     Field('name', notnull=True, unique=True),
>     format='%(name)s')
>
> any ideas what's bothering mysql? 
>
>
> On Wednesday, August 1, 2012 4:56:03 PM UTC+3, Massimo Di Pierro wrote:
>>
>> db = DAL('mysql://....', check_reserved=['common','mysql'])
>>
>> Anyway, I am not sure your problem is that you are using  a reserved 
>> keyword. Perhaps the table exists already. I am also surprised you are 
>> getting a pymysql InternalError and not an OperationalError.
>>
>> On Wednesday, 1 August 2012 07:45:01 UTC-5, Aurelijus Useckas wrote:
>>>
>>> I've changed the long into longitude and it seems to be solved but I 
>>> still get errors:
>>>
>>> p2
>>> S'<class \'gluon.contrib.pymysql.err.InternalError\'> (1005, u"Can\'t 
>>> create table \'./lpkdb/asoc.frm\' (errno: 150)")'
>>>
>>> Now it says it cannot create next table, which is:
>>>
>>> db.define_table('asoc',
>>>     Field('name', label='Pavadinimas', unique=True),
>>>     Field('City', db.city, 'list:reference city', label='Miestas'),
>>>     Field('address', label='Adresas'),
>>>     Field('www'),
>>>     Field('tel'),
>>>     Field('fax'),
>>>     Field('email'),
>>>     Field('President', label='Asociacijos prezidentas'),
>>>     Field('CEO', label='Asociacijos generalinis'),
>>>     Field('CEO_tel', label='Generalinio tel.'),
>>>     Field('CEO_email', label='Generalinio email'),
>>>     Field('CEO_mob', label='Generalinio mobilus'),
>>>     Field('Pres_tel', label='Prezidento tel.'),
>>>     Field('Pres_email', label='Prezidento email'),
>>>     Field('Pres_mob', label='Prezidento mobilus'),
>>>     Field('submited_at', 'datetime', default=request.now, 
>>> writable=False, readable=False),
>>>     Field('updated_at', 'datetime', default=request.now, 
>>> update=request.now, writable=False, readable=False),
>>>     Field('submited_by', db.auth_user, default=auth.user_id, 
>>> writable=False, readable=False),
>>>     Field('updated_by', db.auth_user, update=auth.user_id, 
>>> writable=False, readable=False),
>>>     format='%(name)s')
>>>
>>> Are there some guidlines on how to construct DAL field names in order to 
>>> avoid any conflict while migrating to mysql?
>>>  
>>>
>>> On Wednesday, August 1, 2012 3:36:51 PM UTC+3, tomasz bandura wrote:
>>>>
>>>> Is it 'long' a mysql's reserved word?
>>>>
>>>> Regards
>>>> Tomasz
>>>>
>>>> 2012/8/1 Aurelijus Useckas <aurelijus.usec...@gmail.com>
>>>>
>>>>> this is the trigger i guess:
>>>>>
>>>>> db.define_table('maps',
>>>>>     Field('name'),
>>>>>     Field('last_name'),
>>>>>     Field('long'),
>>>>>     Field('lat'),
>>>>>     format='%(name)s')
>>>>>
>>>>> On Wednesday, August 1, 2012 3:30:40 PM UTC+3, Aurelijus Useckas wrote:
>>>>>>
>>>>>> Hi, 
>>>>>>
>>>>>> I've built the app on SQLite and now want to migrate to the server 
>>>>>> based mysql. BUT web2py hangs in the middle of creating, basicaly just 
>>>>>> after the auth tables. When I restart the apache I can see auth tables 
>>>>>> as 
>>>>>> well as a few from my app.
>>>>>>
>>>>>> this is the err ticket that I get:
>>>>>>
>>>>>> (dp1
>>>>>> S'output'
>>>>>> p2
>>>>>> S'<class \'gluon.contrib.pymysql.err.**ProgrammingError\'> (1064, 
>>>>>> u"You have an error in your SQL syntax; check the manual that 
>>>>>> corresponds 
>>>>>> to your MySQL server version for the right syntax to use near \'long 
>>>>>> VARCHAR(255),\\n    lat VARCHAR(255),\\n    PRIMARY KEY(id)\\n) 
>>>>>> ENGINE=InnoDB CHA\' at line 5")'
>>>>>> p3
>>>>>> sS'layer'
>>>>>> p4
>>>>>> S'/opt/web-apps/web2py/**applications/init/models/db_**comp.py'
>>>>>> p5
>>>>>> sS'code'
>>>>>> p6
>>>>>>
>>>>>> thnx
>>>>>>
>>>>>  -- 
>>>>>  
>>>>>  
>>>>>  
>>>>>
>>>>
>>>>

-- 



Reply via email to