It's hard to say what the original problem could have been, but once you do a fake migrate, the DAL will think the current table definition represents the state of the database and will therefore not attempt any migration. You can try the following:
- Comment out the lines with the two new fields. - Delete the *.table file associated with this table from the /databases folder. - Run a fake_migrate so the *.table file is re-created with the existing fields (not the two new fields). - Uncomment the two new fields. - Run a real migration. If that doesn't work, check the sql.log file to see if the DAL at least attempted the migration. Anthony On Friday, August 17, 2018 at 11:31:03 PM UTC-4, Erik wrote: > > Hi, > > First and foremost, I recently upgraded to 2.17.1, so I'm not sure if my > issues is related to that. > > I had this table originally and it was all working fine: > db.define_table('collection', > Field('name', 'string', required=True), > Field('description', 'text'), > Field('created_at', 'datetime', default=request.utcnow), > format='%(id)s %(name)s') > > Then recently, I decided to add 2 new fields as shown below: > db.define_table('collection', > Field('name', 'string', required=True), > > * Field('website_url', 'string'), > Field('project_management_url', 'string'),* > Field('description', 'text'), > Field('created_at', 'datetime', default=request.utcnow), > format='%(id)s %(name)s') > > When I try to access the table above through appadmin it throws an > exception. I checked my mysql db and sure enough, it's not altering the > table to add the two new columns. I tried sqlite and that seems to work as > expected. > > I'm not sure what's going on with mysql, that's not adding the new > columns. I tried doing fake_migrate=True and even migrate=True as I had > seen on some forums online, but that didn't work for me. > > Any ideas what can the problem be? > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.