qwat-data-model icon indicating copy to clipboard operation
qwat-data-model copied to clipboard

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

Open varrieta opened this issue 2 years ago • 9 comments

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

I used the files qwat_v1.3.6_structure_only.sql and after that qwat_v1.3.6_value_list_data_only.sql.

The issue was reproduced by @olivierdalang

varrieta avatar May 23 '22 12:05 varrieta

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

ponceta avatar May 24 '22 11:05 ponceta

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 avatar May 24 '22 12:05 varrieta

@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 avatar Sep 15 '23 06:09 varrieta

And the issue remain with v 1.4

varrieta avatar Sep 15 '23 07:09 varrieta

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

sjib avatar Sep 18 '23 11:09 sjib

@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 );

sjib avatar Sep 18 '23 11:09 sjib

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

varrieta avatar Sep 20 '23 12:09 varrieta

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.

sjib avatar Sep 20 '23 13:09 sjib

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.

ponceta avatar Sep 21 '23 07:09 ponceta