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