A tricks I use when adding new table to backend, since I don't want to turn migration on over production system is to create an dummy app call generate_sql for instance... When I add new table in my main app, I copy the web2py model defined in the models file in the dummy app, access the app for one turn to make the migration create the table in the backend which is not using the same database. Then once the tables are created in this other database, I use pgdaminIII to access the other db and take the dml sql code then copy it in another instance of pgadmin pointing over my production app and execute it. Then my table(s) is(are) created... Job done as long as I didn't make any mistake in my web2py model definition in the first place... If I did, I modify the model copy it in my generate_sql app access the app, backend table get fix as there is no data into it. This may fail some time if the modification made to the model are related to field type modification since web2py migration can't delete field and there is column type that can't be modify from one to the other. Those are related to SQL limitations not web2py modification. I am not sure of that, but I think that when there is not data web2py migration is able to delete and recreate a field for which type change in a way that require the column to be dropped and recreate.
So far, this approach save me a lot of work to manually create table in SQL, I can write once model in web2py. I know it not ideal and kind of not respecting the workflow of web2py thought the web2py migration are not affordable to me in case of live system that contains a lot of data who is still under developpement. So, to avoid any risk of losing information, I adopted this practice long time ago. Richard On Mon, Feb 6, 2017 at 12:28 PM, MarkEdson AtWork <[email protected]> wrote: > If the code that reads AppConfig can't handle whitespace then this bug > should definitely be fixed! > This type of bug can be very difficult to find because it is so esoteric. > > On Sunday, February 5, 2017 at 12:26:51 AM UTC-8, Ben Lawrence wrote: >> >> ok, my dumbness >> the AppConfig module doesn't like '=' not aligned so instead of this >> ; db configuration >> [db] >> uri = postgres://xxxxx:xxxxx/xxxx >> migrate = 1 >> pool_size = 10 >> >> I had this >> [db] >> uri = postgres://xxxxx:xxxxx/xxxx >> migrate = 1 >> pool_size = 10 >> >> and that is why as I understand, that last description didn't work! >> >> >> On Wednesday, December 28, 2016 at 6:18:10 AM UTC+8, Mark Graves wrote: >>> >>> Hopefully this is solved, but a simple test is to use the original >>> appconfig.ini with storage.sqlite as the connection string. >>> >>> That will tell you if it is a syntax problem, at least. >>> >>> -Mark >>> >>> >>> >>> On Monday, December 26, 2016 at 7:08:23 PM UTC-6, Ben Lawrence wrote: >>>> >>>> seems to be an appconfig problem. if I don't use appconfig.ini and >>>> place the info in db.py, everything works. >>>> >>>> On Friday, December 23, 2016 at 6:16:12 AM UTC-8, Ben Lawrence wrote: >>>>> >>>>> Andre, did you solve this? For me pg 9.5 on remote ubuntu 16, web2py >>>>> is not creating the tables. >>>>> >>>>> On Sunday, September 4, 2016 at 6:55:54 AM UTC-7, Morganti wrote: >>>>>> >>>>>> Hi people! >>>>>> >>>>>> I just almost in go-live. So, I tried to create a Postgresql database >>>>>> and starting to configure some config tables for my appliacation, but I >>>>>> had >>>>>> the error below. >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File >>>>>> "/home/andre/Dropbox/Projetos/web2py/applications/87k/controllers/appadmin.py", >>>>>> line 249, in select >>>>>> nrows = db(query, ignore_common_filters=True).count() >>>>>> File >>>>>> "/home/andre/Dropbox/Projetos/web2py/gluon/packages/dal/pydal/objects.py", >>>>>> line 2010, in count >>>>>> return db._adapter.count(self.query, distinct) >>>>>> File >>>>>> "/home/andre/Dropbox/Projetos/web2py/gluon/packages/dal/pydal/adapters/base.py", >>>>>> line 1322, in count >>>>>> return self.cursor.fetchone()[0] >>>>>> IndexError: list index out of range >>>>>> >>>>>> Thanks >>>>>> Best regards >>>>>> André >>>>>> >>>>>> >>>>>> -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

