Self-contradiction in the book regarding migration?

27 views
Skip to first unread message

webm...@trytha.com

unread,
Jul 22, 2016, 4:30:56 PM7/22/16
to web2py-users
I'm trying to add a field to my DB in GAE (which is a huge headache for some reason?) and was taking a look at the book but noticed this self-contradicting statement regarding migrations:

The solution consists of disabling migrations for all tables and enabling fake migrations:

1
db.define_table(...., migrate=True, fake_migrate=True)

Shouldn't it be "migrate=False, fake_migrate=True"?  Or is the introductory sentence wrong?

Niphlod

unread,
Jul 26, 2016, 10:31:49 AM7/26/16
to web2py-users
maybe a wrong choice of wording but "disabling migrations and enabling fake migrations" REALLY turns out to be activated with migrate=True, fake_migrate=True.

migrate=False short-circuits at the highest level any migration logic, and it's the fastest "mode" to use on production, when you're - usually - sure that the model described in python and your backend are completely in-sync. 

tl;dr: migrate=False automatically discards any value you give to fake_migrate. Same applies for migrate and fake_migrate_all at the DAL() instantiation.
Reply all
Reply to author
Forward
0 new messages