Re: [web2py] Re: Deploy with postgresql
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 AtWorkwrote: > 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://x:x/ >> migrate= 1 >> pool_size = 10 >> >> I had this >> [db] >> uri = postgres://x:x/ >> 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 web2py+unsubscr...@googlegroups.com. > 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
[web2py] Re: Deploy with postgresql
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://x:x/ > migrate= 1 > pool_size = 10 > > I had this > [db] > uri = postgres://x:x/ > 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
ok, my dumbness the AppConfig module doesn't like '=' not aligned so instead of this ; db configuration [db] uri= postgres://x:x/ migrate= 1 pool_size = 10 I had this [db] uri = postgres://x:x/ 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
it's one of the two: either migrations are turned off, or are turned on and you have .table files in the databases/ folder (that tell web2py "hey, tables are already there!") On Monday, September 5, 2016 at 11:04:42 PM UTC+2, Morganti wrote: > > Hi, > > I checked an the migrations are enabled! I dont know where is the problem. > I checked to try to create the tables directly in postgresql and it is > running normal. But, using web2py... > > Thanks > > Em segunda-feira, 5 de setembro de 2016 13:11:04 UTC-3, Niphlod escreveu: >> >> appadmin shows the tables you DEFINED in the model. >> If there aren't real table on the backend to "sustain" those models, you >> get the error. >> You need to let web2py create the tables in your fresh database (enable >> migrations, hit appadmin at least once, then disable migrations for >> production use). >> >> >> On Monday, September 5, 2016 at 12:17:18 PM UTC+2, Morganti wrote: >>> >>> Hi! >>> >>> In appadmin the tables are there but, checking in pgadmin3 them aren´t >>> there. Looks like they were not being created. But, the database is created >>> and I am able to create tables directly in pgadmin even prompt from ubuntu. >>> >>> I reinstall everything and got the problem again. >>> >>> Thank you very much! >>> BR >>> >>> >>> Em segunda-feira, 5 de setembro de 2016 04:33:49 UTC-3, Niphlod escreveu: seemingly no response was given to a simple "how many records are there". sure the tables have been created ? On Sunday, September 4, 2016 at 3:55:54 PM UTC+2, 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
Hi, I checked an the migrations are enabled! I dont know where is the problem. I checked to try to create the tables directly in postgresql and it is running normal. But, using web2py... Thanks Em segunda-feira, 5 de setembro de 2016 13:11:04 UTC-3, Niphlod escreveu: > > appadmin shows the tables you DEFINED in the model. > If there aren't real table on the backend to "sustain" those models, you > get the error. > You need to let web2py create the tables in your fresh database (enable > migrations, hit appadmin at least once, then disable migrations for > production use). > > > On Monday, September 5, 2016 at 12:17:18 PM UTC+2, Morganti wrote: >> >> Hi! >> >> In appadmin the tables are there but, checking in pgadmin3 them aren´t >> there. Looks like they were not being created. But, the database is created >> and I am able to create tables directly in pgadmin even prompt from ubuntu. >> >> I reinstall everything and got the problem again. >> >> Thank you very much! >> BR >> >> >> Em segunda-feira, 5 de setembro de 2016 04:33:49 UTC-3, Niphlod escreveu: >>> >>> seemingly no response was given to a simple "how many records are >>> there". sure the tables have been created ? >>> >>> On Sunday, September 4, 2016 at 3:55:54 PM UTC+2, 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
appadmin shows the tables you DEFINED in the model. If there aren't real table on the backend to "sustain" those models, you get the error. You need to let web2py create the tables in your fresh database (enable migrations, hit appadmin at least once, then disable migrations for production use). On Monday, September 5, 2016 at 12:17:18 PM UTC+2, Morganti wrote: > > Hi! > > In appadmin the tables are there but, checking in pgadmin3 them aren´t > there. Looks like they were not being created. But, the database is created > and I am able to create tables directly in pgadmin even prompt from ubuntu. > > I reinstall everything and got the problem again. > > Thank you very much! > BR > > > Em segunda-feira, 5 de setembro de 2016 04:33:49 UTC-3, Niphlod escreveu: >> >> seemingly no response was given to a simple "how many records are there". >> sure the tables have been created ? >> >> On Sunday, September 4, 2016 at 3:55:54 PM UTC+2, 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
Hi! In appadmin the tables are there but, checking in pgadmin3 them aren´t there. Looks like they were not being created. But, the database is created and I am able to create tables directly in pgadmin even prompt from ubuntu. I reinstall everything and got the problem again. Thank you very much! BR Em segunda-feira, 5 de setembro de 2016 04:33:49 UTC-3, Niphlod escreveu: > > seemingly no response was given to a simple "how many records are there". > sure the tables have been created ? > > On Sunday, September 4, 2016 at 3:55:54 PM UTC+2, 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Deploy with postgresql
seemingly no response was given to a simple "how many records are there". sure the tables have been created ? On Sunday, September 4, 2016 at 3:55:54 PM UTC+2, 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.