Add namespace_id as constraints to layer_feature
If layer contains more than one potential namespace, features will be created for each namespace. Layer_feature table now has to contains one more constrains (namespace_id).
This commit is contained in:
parent
60ef726677
commit
60b0bd27fa
@ -90,7 +90,7 @@ var (
|
||||
feature_id INT REFERENCES feature ON DELETE CASCADE,
|
||||
detector_id INT REFERENCES detector ON DELETE CASCADE,
|
||||
namespace_id INT REFERENCES namespace ON DELETE CASCADE,
|
||||
UNIQUE (layer_id, feature_id));`,
|
||||
UNIQUE (layer_id, feature_id, namespace_id));`,
|
||||
`CREATE INDEX ON layer_feature(layer_id);`,
|
||||
|
||||
`CREATE TABLE IF NOT EXISTS layer_namespace (
|
||||
|
@ -121,7 +121,7 @@ func queryPersistFeature(count int) string {
|
||||
func queryPersistLayerFeature(count int) string {
|
||||
return queryPersist(count,
|
||||
"layer_feature",
|
||||
"layer_feature_layer_id_feature_id_key",
|
||||
"layer_feature_layer_id_feature_id_namespace_id_key",
|
||||
"layer_id",
|
||||
"feature_id",
|
||||
"detector_id",
|
||||
|
Loading…
Reference in New Issue
Block a user