I had a setup that was working. But it's broken after I changed the name of
a table. This was what I did:
1. Shut down web2py
2. Edit the model - table name + all references to the table name
3. Edit the sqlite - table name
4. Set fake_migrate_all=True
5. Start the server
6. Load a page
7. Take away fake_migrate_all=True
Pages load fine without errors, until I needed to write to the db. This is
the traceback:
Traceback (most recent call last):
File ".../web2py/gluon/restricted.py", line 216, in restricted
exec(ccode, environment)
File ".../web2py/applications/myapp/controllers/mycontroller.py:index",
line 136, in <module>
File ".../web2py/gluon/globals.py", line 405, in <lambda>
self._caller = lambda f: f()
File ".../web2py/applications/myapp/controllers/mycontroller.py:index",
line 15, in index
File ".../web2py/applications/myapp/modules/mymodule.py", line 87, in
write_to_db
res = t.update_or_insert(q, **ins)
File ".../web2py/gluon/packages/dal/pydal/objects.py", line 804, in
update_or_insert
newid = self.insert(**values)
File ".../web2py/gluon/packages/dal/pydal/objects.py", line 741, in insert
ret = self._db._adapter.insert(self, self._listify(fields))
File ".../web2py/gluon/packages/dal/pydal/adapters/base.py", line 492, in
insert
raise e
OperationalError: no such table: main.abcde_sites
Some notes...
- "abcde_sites" is the old table name
- I have no idea why "main." will appear in front of it.
- I don't have any code that says "abcde_sites" in my controllers,
modules or models. They have been updated to the new table name,
"collective_sites"
- I created a new app, copied all the code I have in controllers,
models, modules and it works (pages load fine, can write to db)
- I tried deleting all the .table files + sql.log, do a
fake_migrate_all=True, and it still doesn't work (when the code that writes
stuff to sqlite db is evoked)
- I tried the deleting of .table files + sql.log with restarting the
server, and it still doesn't work
Please advise!
Thank you!
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.