New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade tgis db #306
Upgrade tgis db #306
Conversation
c4349a5 implements "Option 3: upgrade_temporal_database() could drop and re-create all views regardless version upgrade" please test |
Backup how to message improved. Now also
|
Previous version of message is printed only when running very old tgis version (1). For TGIS created with GRASS76+ only
@veroandreo @neteler Please review. |
I would expect you should at least run the existing tests before you merge pretty large change. BTW, consider using some Python static code analysis in your editor, it can very easily catch simple mistakes like this. |
Ops, thanks for the fix. |
This PR introduces ability to upgrade TGIS DB version, only upgrade from version 2 (before introducing band references support, see #63) to 3 (with band ref support) is supported. Please note that this is work-in-progress PR. Main open issues:
t.upgrade
(*), or-u
flag tot.connect
, but it's a C module. For implementation Python is required.When upgrading db, 2 raster views must be recreated.
Option 1: duplicate
raster_views.sql
content inupgrade_db_2_to_3.sql
(ugly)Option 2: execute
raster_views.sql
byupgrade_temporal_database()
only when upgrading from 2 to 3 (less ugly, but still not nice)Option 3:
upgrade_temporal_database()
could drop and re-create all views regardless version upgradeOption 4: your suggestions...
(*) Minimalistic t.upgrade.py
Usage
Having TGIS DB created before introducing band reference support.
Do upgrade:
Now let's try
t.info
command again.Be aware that band references metadata are not magically introduced to existing datasets.
You need to create new register file containing band references and register raster maps by
t.register
again to rewrite existing metadata.