Ok I tried the first request with fake_migrate = True, then everything 
works fine. The app runs. I open the web2py shell and run the db.tables 
command it list the default auth tables only,  with the customized names.
But these tables contains only the default auth fields in it, but in my 
dump file I have quite a number of fields.
I then remove the fake_migrate argument and run the app. The same result is 
found. Only the default fields are there with the values.

Isnt the web2py shell supposed to show all the fields in the database.

On Friday, 16 August 2013 17:57:57 UTC+5:30, Niphlod wrote:
>
> if your models match the tables you're creating on mysql manually, then 
> what do you need migration for ?
> set migrate=False ... you did manually what web2py usually does 
> automatically.
> I'd also use fake_migrate=True for the first request (then remove it) just 
> to update the relevant .table files in the databases/* folder.
>
> On Friday, August 16, 2013 2:25:13 PM UTC+2, ajith c t wrote:
>>
>> So does that mean I dont have to specify any migrate keyword?  I just 
>> have a file with custom auth table definitons and need to use it. 
>>
>> On Friday, 16 August 2013 17:49:29 UTC+5:30, Niphlod wrote:
>>>
>>> if you create your tables you can't enable migrations in web2py, 'cause 
>>> web2py will try to create them.
>>>
>>> On Friday, August 16, 2013 2:11:44 PM UTC+2, ajith c t wrote:
>>>>
>>>> Hi,
>>>>           I have defined my auth_tables in a mysql file along with some 
>>>> initial row for my app. The name of this file is '*dump.sql*'. 
>>>>  
>>>> I have renamed the tables, for example auth_users is changed to 
>>>> t_auth_users, similarly the other auth_tables too.
>>>>
>>>> So when the app is hosted the db is created from this file. 
>>>>
>>>> In the db.py file before the db.define_tables(), i have renamed the 
>>>> auth_tables, for example: 
>>>>
>>>>   *auth.settings.table_user_name = 't_auth_users' *
>>>>  
>>>> and similarly others too. My question is how to efficiently handle this 
>>>> migration. I cannot get my auth tables modified according to the defintion 
>>>> in the dump.sql file.
>>>>
>>>> Instead the table is created with default fields only. I have around 20 
>>>> fields for the t_auth_users table in dump.sql but only the 9 defaults 
>>>> fields can be seen in webp2y shell db.t_auth_users command.
>>>>
>>>> this is the order:
>>>>
>>>> 1. First I clear all the files in databases folder for a fresh start.
>>>> 2. Then load the dump.sql file into the database '*tv*' 
>>>> 3.  in db.py
>>>>            *db = DAL('mysql://root:root@localhost/trustvouch', 
>>>> migrate=True)*
>>>> *           *
>>>> *            auth.settings.table_user_name = 't_auth_users'*
>>>> *           *
>>>> *            **auth.define_tables(username=True, migrate=True)*
>>>> 4. It give me this error,
>>>> *           <class '_mysql_exceptions.OperationalError'> (1050, "Table 
>>>> 'tv_auth_users' already exists")*
>>>> *
>>>> *
>>>> *
>>>> *
>>>> Can you help how to get the correct migration of the tables.
>>>>
>>>> What I actually need to do is load my  table definitions from another 
>>>> mysql dump file ,  use the tables defined there as my auth tables.
>>>>            
>>>> *
>>>> *
>>>>
>>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to