aboutsummaryrefslogtreecommitdiff
path: root/federationsender
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-07-23 10:22:23 +0100
committerGitHub <noreply@github.com>2020-07-23 10:22:23 +0100
commitcfeb1b2f4281c9b9b420f9ed9166cd4d8e549288 (patch)
treeb217151a4c844c7db446ecd20c7ba5fb9d126e17 /federationsender
parent9684efebd739a48bd41c9884e311e32eecf82278 (diff)
Add UNIQUE constraint to blacklist table (#1216)
Diffstat (limited to 'federationsender')
-rw-r--r--federationsender/storage/postgres/blacklist_table.go3
-rw-r--r--federationsender/storage/sqlite3/blacklist_table.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/federationsender/storage/postgres/blacklist_table.go b/federationsender/storage/postgres/blacklist_table.go
index f1db9fae..8de6feec 100644
--- a/federationsender/storage/postgres/blacklist_table.go
+++ b/federationsender/storage/postgres/blacklist_table.go
@@ -25,7 +25,8 @@ import (
const blacklistSchema = `
CREATE TABLE IF NOT EXISTS federationsender_blacklist (
-- The blacklisted server name
- server_name TEXT NOT NULL
+ server_name TEXT NOT NULL,
+ UNIQUE (server_name)
);
`
diff --git a/federationsender/storage/sqlite3/blacklist_table.go b/federationsender/storage/sqlite3/blacklist_table.go
index 3e302906..a14fe0c4 100644
--- a/federationsender/storage/sqlite3/blacklist_table.go
+++ b/federationsender/storage/sqlite3/blacklist_table.go
@@ -25,7 +25,8 @@ import (
const blacklistSchema = `
CREATE TABLE IF NOT EXISTS federationsender_blacklist (
-- The blacklisted server name
- server_name TEXT NOT NULL
+ server_name TEXT NOT NULL,
+ UNIQUE (server_name)
);
`