postgres not making new table in model

38 views
Skip to first unread message

Jordan Ladora

unread,
Feb 12, 2018, 2:50:06 PM2/12/18
to web2py-users
I've got a postgres server running which has been working fine the last month or so with no issues.

I just added a new table in a model but cannot get the migration to work. Everything was updated correctly in the databases folder after doing this, and I've got

migrate=True

...in all my table declarations and

migrate=True
fake_migrate_all=True

...in my DAL string.

I tried trashing all the files in the databases folder (which were recreated properly by w2p, including making a new one for the new table), restarting postgres, and turning migrate and fake_migrate_all to either True or False. But I kept getting tickets with 'relation <table_name> does not exist' when trying to do an insert. Listing all the tables in postgres does not show the new table, so I'm thinking I'm probably missing something in a model.

Thanks for any suggestions,
-jl

Anthony

unread,
Feb 12, 2018, 3:41:38 PM2/12/18
to web2py-users
You don't want fake_migrate_all=True if you want to do a real migration -- that instead does a fake migration of all tables, meaning it generates the *.table metadata files in the /databases folder but does not actually do anything to the database. So, get rid of the *.table file of the table you want to create, make sure you do not have fake_migrate_all=True, and then run a request and the migration will happen.

Anthony
Reply all
Reply to author
Forward
0 new messages