Ok, now I have converted to a clean MySQL database (on EC2) so that
the tables are only generated by web2py. Then I ported the data and
set all the tables to migrate=False before uploading to the server,
and STILL I have the same exact issue. The tables that were originally
created through MySQL still generate key errors when I try to access
them through db, and all the others are fine. I tried restarting
apache and mysql. I tried deleting the working directory on the server
and re-cloning it. Tried deleting contents of databases, cache, and
sessions. And to top it off I just rebooted my instance, and suddenly
I can't ssh into it anymore. Ay caramba, not my day.


On Jan 23, 11:02 am, Kenneth Lundström <[email protected]>
wrote:
> I guess theoretically there is nothing wrong in creating tables and then
> writing the model files but in practise it can be quite hard to get them
> exactly correct.
>
> So either write model files for all tables and then let web2py create
> them or create tables in the database, import the table structure
> (web2py writes those model files based on how the tables look like) and
> then add own fields if needed.
>
> Kenneth
>
>
>
>
>
>
>
> > Thanks. Was planning to switch the db over at some point anyway, so
> > guess it might as well be now. Didn't realize mixing existing tables
> > with the DAL was such a no no.
>
> > On Jan 23, 10:03 am, Kenneth Lundstr m<[email protected]>
> > wrote:
> >> Two options:
>
> >> - if possible use an other database of the remote server and let web2py
> >> create all tables and then check whats different between those two 
> >> databases
>
> >> - backup up data on remote server, drop database, create database, let
> >> web2py create tables and try to restore backup.
>
> >> Kenneth
>
> >> Hello,
>
> >>> Today I got web2py running on EC2 and it wasn't too bad despite my
> >>> unix newbie status, but now I've run into a strange problem.
> >>> The app connects to a remote MySQL database. This database was
> >>> partially created and filled directly through MySQL, then we connected
> >>> web2py and let it manage further table creation and updates through
> >>> the DAL. This all went fine and it works locally, but on the EC2
> >>> server, web2py apparently isn't recognizing the tables that we
> >>> originally added through MySQL. Attempting to use these tables with
> >>> db[tablename] gives a KeyError. Tables that were automatically created
> >>> by web2py work fine.
> >>> All the the tables are set with 'fake_migrate=True'. On the server,
> >>> I've tried both syncing the database folders exactly, letting web2py
> >>> generate its own, and many combinations of these two with
> >>> migrate=True, fake_migrate=True, both omitted, migrate for the
> >>> original tables, fake for the others, etc. etc. No luck.
> >>> Any ideas?
> >>> -Dane

Reply via email to