Need to see your code. With fake_migrate_all=True, the DAL will generate 
migration files but no run any migrations, so you cannot get that error.

Anthony

On Thursday, April 5, 2018 at 11:49:38 AM UTC-4, Stephan wrote:
>
> Hi Antony, 
> does not seem to work.
> I still get an error by setting migrate to true. In which directory are 
> the *.table file written to? 
> thx
>
>
>
> <class '_mysql_exceptions.OperationalError'> (1050, "Table 'auth_user' 
> already exists")Version
> web2py™ Version 2.8.2-stable+timestamp.2013.11.28.13.54.07Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
>
> Traceback (most recent call last):
>   File "/home/mhoch4/web2py/gluon/restricted.py", line 217, in restricted
>     exec ccode in environment
>   File "/home/mhoch4/web2py/applications/psychogramm/models/db.py" 
> <https://mhoch4.pythonanywhere.com/admin/default/edit/psychogramm/models/db.py>,
>  line 53, in <module>
>     auth.define_tables(username=False, signature=False)
>   File "/home/mhoch4/web2py/gluon/tools.py", line 1737, in define_tables
>     format='%(first_name)s %(last_name)s (%(id)s)'))
>   File "/home/mhoch4/web2py/gluon/dal.py", line 8139, in define_table
>     table = self.lazy_define_table(tablename,*fields,**args)
>   File "/home/mhoch4/web2py/gluon/dal.py", line 8176, in lazy_define_table
>     polymodel=polymodel)
>   File "/home/mhoch4/web2py/gluon/dal.py", line 1058, in create_table
>     self.create_sequence_and_triggers(query,table)
>   File "/home/mhoch4/web2py/gluon/dal.py", line 1899, in 
> create_sequence_and_triggers
>     self.execute(query)
>   File "/home/mhoch4/web2py/gluon/dal.py", line 1916, in execute
>     return self.log_execute(*a, **b)
>   File "/home/mhoch4/web2py/gluon/dal.py", line 1910, in log_execute
>     ret = self.cursor.execute(command, *a[1:], **b)
>   File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, 
> in execute
>     self.errorhandler(self, exc, value)
>   File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 
> 36, in defaulterrorhandler
>     raise errorclass, errorvalue
> OperationalError: (1050, "Table 'auth_user' already exists")
>
> Am Dienstag, 3. April 2018 21:17:52 UTC+2 schrieb Anthony:
>>
>> Probably you don't have *.table files indicating the current status of 
>> the database schema. First, without the new column in the code, run a 
>> request with fake_migrate_all=True, which will create an updated set of 
>> *.table files. Then add the new column, and the migration should work.
>>
>> Anthony
>>
>> On Tuesday, April 3, 2018 at 12:14:30 PM UTC-4, Stephan wrote:
>>>
>>> I am getting an "tables already exist" error after adding column to an 
>>> existing table in db.py  and setting migrate from false to true. It's 
>>> connected to a mysql. Application is running in version 2.8.2. Is there 
>>> some cahce to be cleared? thx
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to