From 32f9fda33d5f5e88daa4188b637494f3b7af48ca Mon Sep 17 00:00:00 2001
From: Andrew Dolgov <noreply@fakecake.org>
Date: Sun, 10 Mar 2019 15:45:30 +0300
Subject: add composite key on ttrss_feeds (feed_url & owner_uid)

---
 schema/ttrss_schema_pgsql.sql | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'schema/ttrss_schema_pgsql.sql')

diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql
index ca78dd2dc..b5bdba815 100644
--- a/schema/ttrss_schema_pgsql.sql
+++ b/schema/ttrss_schema_pgsql.sql
@@ -99,7 +99,8 @@ create table ttrss_feeds (id serial not null primary key,
 	pubsub_state integer not null default 0,
 	favicon_last_checked timestamp default null,
 	feed_language varchar(100) not null default '',
-	auth_pass_encrypted boolean not null default false);
+	auth_pass_encrypted boolean not null default false,
+	unique(feed_url, owner_uid));
 
 create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid);
 create index ttrss_feeds_cat_id_idx on ttrss_feeds(cat_id);
@@ -268,7 +269,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id);
 
 create table ttrss_version (schema_version int not null);
 
-insert into ttrss_version values (136);
+insert into ttrss_version values (137);
 
 create table ttrss_enclosures (id serial not null primary key,
 	content_url text not null,
-- 
cgit v1.2.3

