<div dir="ltr">Dear devs,<div>with the update to DJango 1.8.7 GeoNode must rely on migrations in order to update the model from an old version to a newest one.</div><div><br></div><div>Basically the "syncdb" is somehow outdated or deprecated (if you want).</div><div><br></div><div>Now, from a point of view this is positive, since the model should be automatically updated by DJango through the migrations, from another one is not since on GeoNode based on Django 1.6.x there wasn't any way to update the model in case of change.</div><div><br></div><div>The potential problems when updating an already existing GeoNode 2.4 DJango 1.6 instance:</div><div><br></div><div>1)</div><div> </div><div>The initial migrations start from a GeoNode model with the mosaics already in there. That means that DJango assumes the old GeoNode is aware of (and should have created already) the 4 columns on the Layer model related to the mosaic:</div><div><ul><li>is_mosaic BOOLEAN<br></li><li>has_time BOOLEAN<br></li><li>has_elevation BOOLEAN<br></li><li>time_regex character varying<br></li><li>elevation_regex character varying<br></li></ul><div>That means that if those columns do not exist on the DB they must be added manually</div></div><div><br></div><div>e.g.:</div><div>====</div><div><div>psql -U geonode geonode</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN is_mosaic BOOLEAN NOT NULL DEFAULT FALSE;</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN has_time BOOLEAN NOT NULL DEFAULT FALSE;</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN has_elevation BOOLEAN NOT NULL DEFAULT FALSE;</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN time_regex character varying(50);</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN elevation_regex character varying(50);</div></div><div><br></div><div><br></div><div>2)</div><div><br></div><div>The Topic Categories are an update to the base model, that means that when updating we must be sure the 0002 migration has been executed.</div><div><br></div><div>3)</div><div><br></div><div>From now on, everytime the GeoNode is updated we MUST be sure the migrations are updated too.</div><div><br></div><div>4)</div><div><br></div><div>The old GeoNode does not know how to migrate "auth" and "content-types"</div><div><br></div><div><br></div><div>Long story short, we should updated the documentation with a set of "use cases" when updating GeoNode from an old 2.4 Django 1.6 based one to a newer 2.4+ DJango 1.8+ based one.</div><div><br></div><div>Most probably the following set of commands </div><div><br></div><div><div>python manage.py syncdb --all</div><div>python manage.py migrate --fake</div><div>python manage.py migrate base 0002</div><div><br></div><div>psql -U geonode geonode</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN is_mosaic BOOLEAN NOT NULL DEFAULT FALSE;</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN has_time BOOLEAN NOT NULL DEFAULT FALSE;</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN has_elevation BOOLEAN NOT NULL DEFAULT FALSE;</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN time_regex character varying(50);</div><div>  geonode=> ALTER TABLE layers_layer ADD COLUMN elevation_regex character varying(50);</div><div><br></div></div><div><br></div><div><br></div><div>should work in the most cases, but it would be quite useful to:</div><div><br></div><div>a)</div><div><br></div><div>Discuss here how we want to manage this thing (we just write a detailed documentation with use case and commands to execute, we try to create some ad-h.o.c management commands to automatize and fix the database, something else...)</div><div><br></div><div>b)</div><div><br></div><div>Try to test as much as possible use cases and take note of the correct sequence of commands to fix the DB and successfully complete the migration process.</div><div><br></div><div>What do you think about that?</div><div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div style="font-size:12.8px">Best Regards,</div><div style="font-size:12.8px">Alessio Fabiani.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>==</div><div>GeoServer Professional Services from the experts!</div><div>Visit <a href="http://goo.gl/it488V" target="_blank">http://goo.gl/it488V</a> for more information.</div><div>==</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Ing. Alessio Fabiani</div><div style="font-size:12.8px">@alfa7691</div><div style="font-size:12.8px">Founder/Technical Lead</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>GeoSolutions S.A.S.</div><div>Via di Montramito 3/A</div><div>55054  Massarosa (LU)</div><div>Italy</div><div>phone: +39 0584 962313</div><div>fax:     +39 0584 1660272</div><div>mob:   +39 331 6233686</div><div><br></div><div><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a></div><div><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">-------------------------------------------------------</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><p><span lang="IT"><font size="1"><b>AVVERTENZE AI SENSI DEL D.Lgs. 196/2003</b></font></span></p><p><span lang="IT"><font size="1">Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.</font></span></p><p><span lang="IT"><font size="1"> </font></span></p><p><font size="1">The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility  for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.</font></p><p><font size="1">---------------------------------------------------------------------</font></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>