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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.