add composite key on ttrss_feeds (feed_url & owner_uid)
This commit is contained in:
parent
95e70320a6
commit
32f9fda33d
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
define('EXPECTED_CONFIG_VERSION', 26);
|
||||
define('SCHEMA_VERSION', 136);
|
||||
define('SCHEMA_VERSION', 137);
|
||||
|
||||
define('LABEL_BASE_INDEX', -1024);
|
||||
define('PLUGIN_FEED_BASE_INDEX', -128);
|
||||
|
|
|
@ -133,7 +133,8 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
|
|||
feed_language varchar(100) not null default '',
|
||||
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
|
||||
foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE SET NULL,
|
||||
foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
|
||||
foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL,
|
||||
unique(feed_url(255), owner_uid)) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
|
||||
|
||||
insert into ttrss_feeds (owner_uid, title, feed_url) values
|
||||
(1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.org/forum/rss.php');
|
||||
|
@ -286,7 +287,7 @@ create table ttrss_tags (id integer primary key auto_increment,
|
|||
|
||||
create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
|
||||
|
||||
insert into ttrss_version values (136);
|
||||
insert into ttrss_version values (137);
|
||||
|
||||
create table ttrss_enclosures (id integer primary key auto_increment,
|
||||
content_url text not null,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
begin;
|
||||
|
||||
alter table ttrss_feeds add constraint ttrss_feeds_feed_url_owner_uid_key unique (feed_url(254), owner_uid);
|
||||
|
||||
update ttrss_version set schema_version = 137;
|
||||
|
||||
commit;
|
|
@ -0,0 +1,7 @@
|
|||
begin;
|
||||
|
||||
alter table ttrss_feeds add constraint ttrss_feeds_feed_url_owner_uid_key unique (feed_url, owner_uid);
|
||||
|
||||
update ttrss_version set schema_version = 137;
|
||||
|
||||
commit;
|
Loading…
Reference in New Issue