From e0257be14a1df1d47498f47b2d2aa15f5a5d8808 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 16 Nov 2005 17:48:29 +0100 Subject: [PATCH] create sql preferences schema --- schema/ttrss_schema_mysql.sql | 40 ++++++++++++++++++++++++++++++++++ schema/ttrss_schema_pgsql.sql | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index d63a9d57..fa4b160c 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -91,4 +91,44 @@ create table ttrss_version (schema_version int not null) TYPE=InnoDB; insert into ttrss_version values (2); +create table ttrss_prefs_types (id integer primary key, + type_name varchar(100) not null) TYPE=InnoDB; + +insert into ttrss_prefs_types (id, type_name) values (1, 'bool'); +insert into ttrss_prefs_types (id, type_name) values (2, 'string'); +insert into ttrss_prefs_types (id, type_name) values (3, 'integer'); + +create table ttrss_prefs_sections (id integer primary key, + section_name varchar(100) not null) TYPE=InnoDB; + +insert into ttrss_prefs_sections (id, section_name) values (1, 'PLACEHOLDER'); + +create table ttrss_prefs (pref_name varchar(250) primary key, + type_id integer not null, + section_id integer not null default 1, + def_value text not null, + value text not null, + index(type_id), + foreign key (type_id) references ttrss_prefs_types(id), + index(section_id), + foreign key (section_id) references ttrss_prefs_sections(id)) TYPE=InnoDB; + +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('CONTENT_CHECK_MD5', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('MIN_UPDATE_TIME', 3, '1800', '1800'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('WEB_DEMO_MODE', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_FEED_ICONS', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_DIR', 2, 'icons', 'icons'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_URL', 2, 'icons', 'icons'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('PURGE_OLD_DAYS', 3, '60', '60'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_LABELS', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_HEADER', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_FOOTER', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('USE_COMPACT_STYLESHEET', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_ARTICLE_LIMIT', 3, '0', '0'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DAEMON_REFRESH_ONLY', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_SPLASH', 1, 'false', 'false'); diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 2a63243a..a892a80f 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -86,3 +86,44 @@ create table ttrss_version (schema_version int not null); insert into ttrss_version values (2); +drop table ttrss_prefs; +drop table ttrss_prefs_types; +drop table ttrss_prefs_sections; + +create table ttrss_prefs_types (id integer primary key, + type_name varchar(100) not null); + +insert into ttrss_prefs_types (id, type_name) values (1, 'bool'); +insert into ttrss_prefs_types (id, type_name) values (2, 'string'); +insert into ttrss_prefs_types (id, type_name) values (3, 'integer'); + +create table ttrss_prefs_sections (id integer primary key, + section_name varchar(100) not null); + +insert into ttrss_prefs_sections (id, section_name) values (1, 'PLACEHOLDER'); + +create table ttrss_prefs (pref_name varchar(250) primary key, + type_id integer not null references ttrss_prefs_types(id), + section_id integer not null references ttrss_prefs_sections(id) default 1, + def_value text not null, + value text not null); + +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('CONTENT_CHECK_MD5', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('MIN_UPDATE_TIME', 3, '1800', '1800'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('WEB_DEMO_MODE', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_FEED_ICONS', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_DIR', 2, 'icons', 'icons'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_URL', 2, 'icons', 'icons'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('PURGE_OLD_DAYS', 3, '60', '60'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_LABELS', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_HEADER', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_FOOTER', 1, 'true', 'true'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('USE_COMPACT_STYLESHEET', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_ARTICLE_LIMIT', 3, '0', '0'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DAEMON_REFRESH_ONLY', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'false'); +insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_SPLASH', 1, 'false', 'false'); + -- 2.39.5