Closed bradh closed 6 years ago
Something like? -note extra not null on mapping_table_name:
CREATE TABLE 'gpkgext_relations' (
id INTEGER PRIMARY KEY AUTOINCREMENT,
base_table_name TEXT NOT NULL,
base_primary_column TEXT NOT NULL DEFAULT 'id',
attribute_table_name TEXT NOT NULL,
attribute_primary_column TEXT NOT NULL DEFAULT 'id',
relation_name TEXT NOT NULL,
mapping_table_name TEXT NOT NULL UNIQUE,
cardinality TEXT NOT NULL CHECK( cardinality in ('many-to-many','many-to-one','one-to-many'))
);
Yep.
Ref: mapping_table_name
not null PR at #18.
The
cardinality
column has a limited range of values. That could be enforced by SQL triggers as we have for the base spec.