summaryrefslogtreecommitdiff
path: root/src/schema.sql
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-06-29 09:33:57 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-06-29 09:33:57 +0100
commit26eda4262fa99888e254e9c19b40c04b2a29a75c (patch)
treec1f2fdeb8d36d9e663b5a2f25842b7b59574e822 /src/schema.sql
parentad2a2ff05af8df1ba552d906e377afa345a449a7 (diff)
downloadwebstat-26eda4262fa99888e254e9c19b40c04b2a29a75c.tar.bz2
webstat-26eda4262fa99888e254e9c19b40c04b2a29a75c.tar.xz
webstat-26eda4262fa99888e254e9c19b40c04b2a29a75c.zip
Fix uniqueness of entities
Should be unique for value and type, they're not just strings, they can be different things with the same value... Albeit rarely.
Diffstat (limited to 'src/schema.sql')
-rw-r--r--src/schema.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/schema.sql b/src/schema.sql
index 6f28f2d..0062538 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -40,7 +40,7 @@ CREATE TABLE entities(
CONSTRAINT pk_entities PRIMARY KEY (id)
);
-CREATE UNIQUE INDEX uni_entities_value ON entities(MD5(value));
+CREATE UNIQUE INDEX uni_entities_value ON entities(MD5(value), type);
CREATE INDEX idx_entities_retryinsert ON entities(id)
WHERE