diff options
author | Art4 <[email protected]> | 2015-02-19 23:17:43 +0100 |
---|---|---|
committer | Art4 <[email protected]> | 2015-02-19 23:17:43 +0100 |
commit | d9c042c4c536f1afbf206aeea09b0b127b7b6418 (patch) | |
tree | 9d7ef18c6d9d4c8f8f4d1c9a5dbfceeb9fd5acf4 /schema | |
parent | cf42b79120290ee5866136a0c4656e6999f06045 (diff) | |
parent | 4ca621a36016de1fbb5447e1c1de0b607ba94a7c (diff) |
Merge branch 'master' into patch-1
Conflicts:
locale/de_DE/LC_MESSAGES/messages.po
Diffstat (limited to 'schema')
-rw-r--r-- | schema/ttrss_schema_mysql.sql | 16 | ||||
-rw-r--r-- | schema/ttrss_schema_pgsql.sql | 7 | ||||
-rw-r--r-- | schema/versions/mysql/127.sql | 18 | ||||
-rw-r--r-- | schema/versions/pgsql/127.sql | 8 |
4 files changed, 30 insertions, 19 deletions
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index a9a358220..6cb153731 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -133,9 +133,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key, view_settings varchar(250) not null default '', pubsub_state integer not null default 0, favicon_last_checked datetime default null, - index(owner_uid), foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, - index(cat_id), foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE SET NULL, index(parent_feed), foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8; @@ -167,7 +165,6 @@ create table ttrss_entries (id integer not null primary key auto_increment, author varchar(250) not null default '') ENGINE=InnoDB DEFAULT CHARSET=UTF8; create index ttrss_entries_date_entered_index on ttrss_entries(date_entered); -create index ttrss_entries_guid_index on ttrss_entries(guid); create index ttrss_entries_updated_idx on ttrss_entries(updated); create table ttrss_user_entries ( @@ -187,13 +184,10 @@ create table ttrss_user_entries ( last_marked datetime, last_published datetime, unread bool not null default 1, - index (ref_id), foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE, - index (feed_id), foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, index (orig_feed_id), foreign key (orig_feed_id) references ttrss_archived_feeds(id) ON DELETE SET NULL, - index (owner_uid), foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; create index ttrss_user_entries_owner_uid_index on ttrss_user_entries(owner_uid); @@ -301,7 +295,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 (126); +insert into ttrss_version values (127); create table ttrss_enclosures (id integer primary key auto_increment, content_url text not null, @@ -311,7 +305,6 @@ create table ttrss_enclosures (id integer primary key auto_increment, duration text not null, width integer not null default 0, height integer not null default 0, - index (post_id), foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) ENGINE=InnoDB DEFAULT CHARSET=UTF8; create index ttrss_enclosures_post_id_idx on ttrss_enclosures(post_id); @@ -347,8 +340,6 @@ create table ttrss_prefs (pref_name varchar(250) not null primary key, index(section_id), foreign key (section_id) references ttrss_prefs_sections(id)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; -create index ttrss_prefs_pref_name_idx on ttrss_prefs(pref_name); - insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('PURGE_OLD_DAYS', 3, '60', 1); insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 1); insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 2); @@ -418,18 +409,15 @@ create table ttrss_user_prefs ( profile integer, index (profile), foreign key (profile) references ttrss_settings_profiles(id) ON DELETE CASCADE, - index (owner_uid), foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, - index (pref_name), foreign key (pref_name) references ttrss_prefs(pref_name) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; create index ttrss_user_prefs_owner_uid_index on ttrss_user_prefs(owner_uid); create index ttrss_user_prefs_pref_name_idx on ttrss_user_prefs(pref_name); -create table ttrss_sessions (id varchar(250) unique not null primary key, +create table ttrss_sessions (id varchar(250) not null primary key, data text, expire integer not null, - index (id), index (expire)) ENGINE=InnoDB DEFAULT CHARSET=UTF8; create table ttrss_feedbrowser_cache ( diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index c09f044fb..36d7f9389 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -148,7 +148,6 @@ create table ttrss_entries (id serial not null primary key, lang varchar(2), author varchar(250) not null default ''); -create index ttrss_entries_guid_index on ttrss_entries(guid); -- create index ttrss_entries_title_index on ttrss_entries(title); create index ttrss_entries_date_entered_index on ttrss_entries(date_entered); create index ttrss_entries_updated_idx on ttrss_entries(updated); @@ -261,7 +260,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 (126); +insert into ttrss_version values (127); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -300,8 +299,6 @@ create table ttrss_prefs (pref_name varchar(250) not null primary key, access_level integer not null default 0, def_value text not null); -create index ttrss_prefs_pref_name_idx on ttrss_prefs(pref_name); - insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('PURGE_OLD_DAYS', 3, '60', 1); insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 1); insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 2); @@ -374,7 +371,7 @@ create index ttrss_user_prefs_owner_uid_index on ttrss_user_prefs(owner_uid); create index ttrss_user_prefs_pref_name_idx on ttrss_user_prefs(pref_name); -- create index ttrss_user_prefs_value_index on ttrss_user_prefs(value); -create table ttrss_sessions (id varchar(250) unique not null primary key, +create table ttrss_sessions (id varchar(250) not null primary key, data text, expire integer not null); diff --git a/schema/versions/mysql/127.sql b/schema/versions/mysql/127.sql new file mode 100644 index 000000000..5dcc23b2f --- /dev/null +++ b/schema/versions/mysql/127.sql @@ -0,0 +1,18 @@ +BEGIN; + +ALTER TABLE ttrss_enclosures DROP INDEX post_id; +ALTER TABLE ttrss_entries DROP INDEX ttrss_entries_guid_index; +ALTER TABLE ttrss_feeds DROP INDEX owner_uid; +ALTER TABLE ttrss_feeds DROP INDEX cat_id; +ALTER TABLE ttrss_prefs DROP INDEX ttrss_prefs_pref_name_idx; +ALTER TABLE ttrss_sessions DROP INDEX id_2; +ALTER TABLE ttrss_sessions DROP INDEX id; +ALTER TABLE ttrss_user_entries DROP INDEX ref_id; +ALTER TABLE ttrss_user_entries DROP INDEX owner_uid; +ALTER TABLE ttrss_user_entries DROP INDEX feed_id; +ALTER TABLE ttrss_user_prefs DROP INDEX pref_name; +ALTER TABLE ttrss_user_prefs DROP INDEX owner_uid; + +UPDATE ttrss_version SET schema_version = 127; + +COMMIT; diff --git a/schema/versions/pgsql/127.sql b/schema/versions/pgsql/127.sql new file mode 100644 index 000000000..7895aacc0 --- /dev/null +++ b/schema/versions/pgsql/127.sql @@ -0,0 +1,8 @@ +BEGIN; + +DROP INDEX ttrss_entries_guid_index; +DROP INDEX ttrss_prefs_pref_name_idx; + +UPDATE ttrss_version SET schema_version = 127; + +COMMIT; |