opengeospatial / geopackage-tiled-gridded-coverage

A GeoPackage extension for tiled, gridded coverage data
Apache License 2.0
5 stars 8 forks source link

UNIQUE constraint needs clarification #2

Closed bradh closed 9 years ago

bradh commented 9 years ago

Table 2 currently has both tpudt_name and tpudt_id as UNIQUE. I don't think that can work.

It could work if they were jointly UNIQUE, something like:

CREATE TABLE gpkg_2D_gridded_tile_ancillary (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    tpudt_name TEXT NOT NULL,
    tpudt_id INTEGER NOT NULL,
    min REAL,
    max REAL,
    mean REAL,
    std_dev REAL,
    CONSTRAINT fk_g2dgtat_name FOREIGN KEY (tpudt_name) REFERENCES gpkg_contents(table_name),
    UNIQUE (tpudt_name, tpudt_id)
)

Suggest updating Table 2 to show this slightly differently (perhaps remove the unique column and just adding it as a text requirement).

jyutzler commented 9 years ago

https://github.com/opengeospatial/geopackage-elevation/blob/master/spec/1_tiled_gridded_elevation_data.adoc#tile-ancillary

jyutzler commented 9 years ago

In today's SWG we agreed to add a footnote.