From 8e8f09db9fb13422f43f9c3268ea2420f63d2560 Mon Sep 17 00:00:00 2001 From: SilverNexus Date: Wed, 23 Nov 2022 18:23:58 -0500 Subject: [PATCH] Add primary key to the region table in the reputation schema. Note this does not actually fix existing DBs, but it should prevent an issue with the region table being filled to the brim with duplicate entries. I still need to either script a path forward for existing tables, or otherwise clean up the duplicate entries. --- python/CFReputation/sql/schema.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/python/CFReputation/sql/schema.sql b/python/CFReputation/sql/schema.sql index bc517113b..200ba2505 100644 --- a/python/CFReputation/sql/schema.sql +++ b/python/CFReputation/sql/schema.sql @@ -4,6 +4,7 @@ CREATE TABLE regions( faction TEXT, region TEXT, -- region name (or 'ALL') this faction controls influence NUMERIC, + PRIMARY KEY (faction, region), CONSTRAINT influence_range CHECK(influence BETWEEN 0 AND 1) );