qwat / qwat-data-model

TEKSI Water module (project QWAT) - PostgreSQL / postgis Datamodel
https://www.teksi.ch
23 stars 24 forks source link

qwat_sys tables are empty when using .sql files for database initialization #357

Open varrieta opened 2 years ago

varrieta commented 2 years ago

qwat_sys tables end up empty when using .sql files for database initialization

I used the files _qwat_v1.3.6_structureonly.sql and after that _qwat_v1.3.6_value_list_dataonly.sql.

The issue was reproduced by @olivierdalang

ponceta commented 2 years ago

Is it working for the wastewater module? Same approach to be replicated?

varrieta commented 2 years ago

Yes, it is working for the wastewater module.

For qgep, you can create the structure and populate the value lists together by using (for example) qgep_1.5.6-1_structure_with_value_lists.sql

varrieta commented 9 months ago

@ponceta Has this issue been discussed within the technical group ? Is there a workaround that could be use for windows user to setup a QWAT database ?

Edit: forgot to say that the same issue happen when using the two .backup files

varrieta commented 9 months ago

And the issue remain with v 1.4

sjib commented 9 months ago

https://github.com/QGEP/QGEP/issues/741 - see differences qgep / qwat

sjib commented 9 months ago

@varrieta You could try something like this:

INSERT INTO qwat_sys.info( version, description, type, installed_by, installed_on, execution_time, success ) VALUES ( '1.0.0', 'baseline', 'postgres', now(), 1, true );

varrieta commented 9 months ago

Is that the only table in qwat_sys that has to be filled ? If it is, I'll proceed as you propose

sjib commented 9 months ago

There is qwat_sys.upgrades with similar attributes – but in the projects I have this table is emtpy. So I do not know what is it’s role.

See https://github.com/QGEP/QGEP/issues/741#issuecomment-1327810992

You might ask @ponceta https://github.com/ponceta or Kevin for more details.

ponceta commented 9 months ago

This is a pertinent issue.

On a single installation you can fix it either with the pum baseline function https://github.com/opengisch/pum#baseline or with the suggested SQL statement proposed by Stefan.

This should be adressed in the release process when defining files to be published at each release knowing that @cymed mentionned that .sql files are more suited for cloud base deployement than custom .backup formats.