Add UNIQUE constraint to blacklist table
MODIFY
federationsender/storage/postgres/blacklist_table.go
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)
);
`

MODIFY
federationsender/storage/sqlite3/blacklist_table.go
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)
);
`

Add UNIQUE constraint to blacklist table (#1216)