From 26eda4262fa99888e254e9c19b40c04b2a29a75c Mon Sep 17 00:00:00 2001
From: Dan Goodliffe <dan.goodliffe@octal.co.uk>
Date: Mon, 29 Jun 2026 09:33:57 +0100
Subject: 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.
---
 src/schema.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/schema.sql')

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
-- 
cgit v1.3

