3liz / qgis-pgmetadata-plugin

QGIS Plugin to manage some metadata from PostgreSQL layer
GNU General Public License v2.0
12 stars 10 forks source link

License attribution/reference #71

Closed effjot closed 7 months ago

effjot commented 3 years ago

Enhancment proposal: It would be great to have an additional field for license numbers, ODC-BY and German Data Licence attributions etc.

effjot commented 2 years ago

I have implemented a licence attribution field in my repo (437c7d4).

There’s a little problem with the tests though. I don’t know Postgresql vey well yet. I would prefer to add the new field license_attribution after the license field; that’s what I did in 20_TABLE_SEQUENCE_DEFAULT.sql for the fresh database. However, the alter table in upgrade_to_1.1.0.sql adds the new field at the end of the table, which makes the test fail. Should I add the new field to the end in fresh databases (20_TABLE_SEQUENCE_DEFAULT.sql), too, as this is mainly a cosmetic concern, or is there a way to add the new field to an existing table after license?

Gustry commented 2 years ago

Can you make a PR ?

I don't think we care about the order in the DB. You can still change the order in the drag&drop form ? (fields can be ordered there) Would it be OK ?

effjot commented 2 years ago

I’ll prepare a PR tomorrow. Yes, the DB order is not that important. It just would look nicer when working with the raw data ;-)

Gustry commented 2 years ago

Ordering fields in a database doesn't seem well supported : https://stackoverflow.com/questions/285733/how-do-i-alter-the-position-of-a-column-in-a-postgresql-database-table/21028894

When exporting data, you can choose explicitly your columns, or make a view. The database is not designed for that.

effjot commented 2 years ago

The ordering “problem” also affects views (v_dataset), but again it’s only a cosmetic issue. ;-)

effjot commented 7 months ago

I think we can close this after PR #85 has been merged.