yep, that can cause troubles. 
table files are named with an hash composed with the uri string, so you can 
import, let's say, table definitions for 10 dbs all in the same folder. 
If table files were created with an uri, and you try to auto_import with 
another uri, web2py will "search" for the "wrong" filenames.

On Wednesday, October 24, 2012 12:08:25 AM UTC+2, Jim S wrote:
>
> Found it.  I had inconsistent case specified in my database name.  When 
> running in web2py it was infoCenter2, when running outside, I had 
> infocenter2.  Changing to infoCenter2 caused it to work correctly.
>
> Niphlod - Thanks for all the help.  I truly appreciate it.
>
> -Jim
>
> On Tue, Oct 23, 2012 at 4:46 PM, Jim Steil <[email protected]<javascript:>
> > wrote:
>
>> Ok, I've got it now to where there are files in the databases directory, 
>> but still getting empty list for print db.tables
>>
>> -Jim
>>
>> On Tue, Oct 23, 2012 at 4:21 PM, Niphlod <[email protected] 
>> <javascript:>>wrote:
>>
>>> auto_import scans the table files for tables. That's the whole point of 
>>> not redefining models (because they are stored in table files that can be 
>>> read).
>>> Normal behaviour is:
>>> DAL(..., migrate=True)
>>> let it define tables, then
>>> DAL(, migrate=False) #or migrate_enabled=False
>>> so table files are never touched again, and can be imported.
>>> PS: big_id isn't saved into table definitions, so you must specify that 
>>> parameter also outside (and it's safe I guess turning migrations off also 
>>> for external access).
>>>
>>> To solve your problem, try one round of 
>>> DAL(..,migrate_enabled=False, fake_migrate_all=True)
>>> fake_migrate_all will fake all table creations and generates the 
>>> relative .table files (of course you must be sure that your table 
>>> definitions are synced with your db structure)
>>> From then on, you should be able to import them
>>> DAL(...,migrate_enabled=False, big_id=True, auto_import=True, 
>>> folder='...')
>>>
>>>
>>>
>>> On Tuesday, October 23, 2012 11:08:04 PM UTC+2, Jim S wrote:
>>>
>>>> It is empty.
>>>>
>>>>
>>>> On Tue, Oct 23, 2012 at 4:01 PM, Niphlod <[email protected]> wrote:
>>>>
>>>>> is your databases folder filled with the .table files relative to the 
>>>>> tables ?
>>>>>
>>>>>
>>>>> On Tuesday, October 23, 2012 10:57:04 PM UTC+2, Jim S wrote:
>>>>>>
>>>>>> Hi - I use MySQL for my database.  In my production environment I'm 
>>>>>> specifying the following:
>>>>>>
>>>>>> db = DAL(infoCenterUtil.getDalString(), migrate=False, 
>>>>>>  migrate_enabled=False, bigint_id=True)
>>>>>>
>>>>>> On my production machine I'm also trying to use the DAL outside of 
>>>>>> web2py with the following:
>>>>>>
>>>>>> import sys
>>>>>> sys.path.append('c:/prod/web2py')
>>>>>> from gluon import DAL, Field
>>>>>> db = DAL('mysql://username:password@server/database',folder=
>>>>>> 'c:/prod/web2py/applications/InfoCenter/databases', auto_import=True)
>>>>>>
>>>>>> print db.tables
>>>>>>
>>>>>> But, I get an empty list when I print db.tables.  On my test machine 
>>>>>> where all of my auto-migrations happen, it works fine.  
>>>>>>
>>>>>> Am I barking up the wrong tree in thinking that migration has 
>>>>>> something to do with my problem (print db.tables give empty list).  If 
>>>>>> not, 
>>>>>> what am I doing wrong?  I don't want auto-migrations on my production 
>>>>>> box. 
>>>>>>  What is the proper way to have no migration on a machine, but allow for 
>>>>>> DAL outside of web2py?
>>>>>>
>>>>>> -Jim
>>>>>>
>>>>> -- 
>>>>>  
>>>>>  
>>>>>  
>>>>>
>>>>
>>>>  -- 
>>>  
>>>  
>>>  
>>>
>>
>>
>

-- 



Reply via email to