Forums

trouble with mysql tables

My colleagues,

I am experiencing a hard time implementing and uploading data to my model (db.py). Initially, I created the database (mysql) and uploaded about files for different 8 different tables. Then I realized that I made a mistake in relation to the size of some fields, and that I had to make them longer to store the numbers correctly. Instead of truncating the tables and then change the model, I did the opposite. From that on, I simply got the same message no matter how I try to fix things in my database:

"<type 'exceptions.RuntimeError'> File /home/gualterrp/bankmark/applications/bankmark/databases/deef3d7fd3360aa33bb06859e9dee708_indicadoresban.table appears corrupted

Versão web2py™ Version 2.14.3-stable+timestamp.2016.03.26.23.02.02 Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr) Traceback . . Traceback (most recent call last): File "/home/gualterrp/bankmark/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/gualterrp/bankmark/applications/bankmark/models/db.py", line 218, in <module> Field('meses_id', 'integer')) File "/home/gualterrp/bankmark/gluon/packages/dal/pydal/base.py", line 834, in define_table table = self.lazy_define_table(tablename,fields,*args) File "/home/gualterrp/bankmark/gluon/packages/dal/pydal/base.py", line 873, in lazy_define_table polymodel=polymodel) File "/home/gualterrp/bankmark/gluon/packages/dal/pydal/adapters/base.py", line 503, in create_table raise RuntimeError('File %s appears corrupted' % table._dbt) RuntimeError: File /home/gualterrp/bankmark/applications/bankmark/databases/deef3d7fd3360aa33bb06859e9dee708_indicadoresban.table appears corrupted Momento do Erro help <type 'exceptions.RuntimeError'>(File /home/gualterrp/bankmark/applications/bankmark/databases/deef3d7fd3360aa33bb06859e9dee708_indicadoresban.table appears corrupted)"

Can anyone tell me how to reset my databases because I do not think there is an error in db.py file, especially because it worked in the beginning and I only made minor changes in the code to properly store the numbers? Thanks in advance.

That ls not complaining that the MySQL table is corrupt. It's complaining that the model definition that web2py uses to translate the table into a model may be corrupt. It may just be that your "fixes" have caused the model definition and the actual table in the database to be different and web2py may be interpreting that as corruption. The web2py forums may be a better place to find the expertise necessary to fix the problem.