Closed gnerred closed 8 years ago
Yes, that's why I had no problem on my preprod instance. The problem was when upgrading my prod.
But did you get your changes in prod with git pull origin <branch>
?
Isn't it automatically done by command make -f prod.mk update ? If I look at my prod, I have the change you mention in my deploy.cfg.mako file.
Indeed, you're right...
I'm out of ideas, sorry
thank you anyway :O)
Are the DB for preprod and prod the same ?
I do not know if the update
command runs the alembic upgrades (the thing which upgraded your preprod instance).
If not, then your error would be normal and you would have to run (after the git pull
):
.build/venv/bin/alembic upgrade head
.build/venv/bin/alembic -c alembic_static.ini upgrade head
No, they are 2 different DB. The aim of the update command is to upgrade automatically, I cannot immagine that we have to run other commands manually. @sbrunner, could you please analyze this problem ?
What does those commends return?
.build/venv/bin/alembic current -v
.build/venv/bin/alembic heads -v
.build/venv/bin/alembic current -v
INFO [alembic.migration] Context impl PostgresqlImpl.
INFO [alembic.migration] Will assume transactional DDL.
Current revision(s) for postgresql://www-data:XXXXX@localhost:5432/cartoriviera:
Rev: 2b8ed8c1df94
Parent: 32527659d57b
Branch names: 1.6
Path: /var/www/vhosts/cartoriviera/private/cartoriviera_geomapfish/CONST_alembic/main/versions/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py
Set layergroup_treeitem.id as a primary key
Revision ID: 2b8ed8c1df94
Revises: 26a8c51827c6
Create Date: 2015-10-29 16:11:24.760733
.build/venv/bin/alembic heads -v
Rev: 22e6dfb556de (head)
Parent: 2b8ed8c1df94
Branch names: 1.6
Path: /var/www/vhosts/cartoriviera/private/cartoriviera_geomapfish/CONST_alembic/main/versions/22e6dfb556de_add_description_tree_.py
Add description column in the tree
Revision ID: 22e6dfb556de
Revises: 2b8ed8c1df94
Create Date: 2015-12-04 13:44:42.475652
@gnerred do you use the deploy tool? If no how do you do to pass the application (code and database) from preprod to prod?
I only do a "make -f prod.mk update", as you told me to do... It automatically takes the code from git. Is it not the same with database config ?
Than the database isn't neither updated and deployed... For the main schema you should do a dump restore from preprod to prod or do:
.build/venv/bin/alembic upgrade head
For the main_static schema you should do:
.build/venv/bin/alembic -c alembic_static.ini upgrade head
I's only when we use the deploy tool that it will automatically done :-)
Ok so @kalbermattenm was right, it was a misunderstanding from my part, sorry, and thanks all for answers !
+1 for myself... :laughing:
@kalbermattenm , if I understand well, those two commands update table structure in main and main_static schema ? No data is transfered, only commands like "alter table" are done ?
Yes exactly.
I just applies the ALTER
commands on the schemes in order for them to correspond to the version of c2cgeoportal you are using, no data should be altered or deleted.
Thanks again
Excellent :-)
I have upgraded my preprod to 1.6.7rc6 with pip install -> OK
I have then upgraded my prod with following commands :
make -f prod.mk update make -f prod.mk build
-> error 500 on prod :
ProgrammingError: (ProgrammingError) column treeitem.description does not exist ProgrammingError: (ProgrammingError) column layergroup_treeitem.description does not exist
I had to add manually this two columns in the schema main of the prod -> OK
It seems that there is a problem with the update command, the step to upgrade the database is missing or is incomplete somewhere.