aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--signature_db.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/signature_db.cpp b/signature_db.cpp
index 1534ee6..638aa0e 100644
--- a/signature_db.cpp
+++ b/signature_db.cpp
@@ -35,7 +35,9 @@ signature_db::signature_db()
create table subslices(
image int,
slice int,
- slicesig text
+ slicesig text,
+ primary key (image, slice),
+ foreign key (image) references images (id)
);
)sql", nullptr, nullptr, nullptr);
sqlite3_exec(p->db, R"sql(
@@ -46,7 +48,8 @@ signature_db::signature_db()
id1 int,
id2 int,
dist real,
- primary key (id1, id2)
+ primary key (id1, id2),
+ foreign key (id1, id2) references images (id, id)
);
)sql", nullptr, nullptr, nullptr);
p->bst = nullptr;