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

Missing comments for tables and columns

Open lbartoletti opened this issue 6 years ago • 9 comments

Tables: 48 Columns: 2962

Some comments can be easy to introduce 'id, geometry, short_XX, etc.'

Maybe travis can warn on this metric - like a coverage doc - and refuse new table or column without comment?

lbartoletti avatar Mar 02 '18 13:03 lbartoletti

This is a must have for the data dictionnary

lbartoletti avatar Mar 07 '18 08:03 lbartoletti

I agree that we should improve the column/tables comments.

tudorbarascu avatar Nov 15 '18 05:11 tudorbarascu

@haubourg @elemoine What do you think about adding control over the new tables, where each column must have a comment to make travis happy?

lbartoletti avatar Nov 15 '18 07:11 lbartoletti

Quick test. Today we have 23 tables without comment

SELECT t.schemaname,
       t.tablename,
       pg_catalog.obj_description(c.oid)
FROM pg_catalog.pg_tables t
LEFT JOIN pg_catalog.pg_class c ON t.tablename = c.relname
WHERE t.schemaname LIKE 'qwat%'
  AND pg_catalog.obj_description(c.oid) IS NULL

lbartoletti avatar Jan 09 '19 14:01 lbartoletti

For columns

SELECT pg_tables.schemaname,
       pg_tables.tablename,
       pg_attribute.attname AS field,
  (SELECT col_description(pg_attribute.attrelid, pg_attribute.attnum) ) AS comment
FROM pg_tables,
     pg_class
JOIN pg_attribute ON pg_class.oid = pg_attribute.attrelid
AND pg_attribute.attnum > 0
WHERE pg_class.relname = pg_tables.tablename
  AND pg_attribute.atttypid <> 0::oid
  AND schemaname LIKE 'qwat%'
ORDER BY 1,2, attnum ASC

Only 44/980 have comments

lbartoletti avatar Jan 09 '19 15:01 lbartoletti

mm, that's quite a work to add all those comments. I've been playing a lot with pgmodeler to document the data model, I think I could help here, but we talks about several dozen of hours here

haubourg avatar Jan 09 '19 15:01 haubourg

It is necessary to proceed by steps. First, I think of commenting on all the tables and requiring that the new tables or views have a description.

We will see later on for the columns.

lbartoletti avatar Jan 10 '19 07:01 lbartoletti

The SIA405 Norm 2015 has a lot of descriptions for the whole water model - it would be anyway good to document how the qwat model connects to this standard.

sjib avatar Jan 23 '19 16:01 sjib

@sjib Agreed! From what I get from @3nids, there is no direct relation with the SIA Norm. I've been working to evaluate the interoperability of the QWAT's Model with other models about 2 years ago. One blocker to me was that it is not easy to refer to the SIA models, UML schema and data dictionnary because it's not an open document. In which extent can we reuse parts of the SIA docs to publish some (open) documents ?

haubourg avatar Jan 23 '19 16:01 haubourg