diff options
author | Andrew Dolgov <[email protected]> | 2010-01-13 18:31:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-01-13 18:31:51 +0300 |
commit | d9084cf22059f709e935c6c0755d2b69c21b3a87 (patch) | |
tree | 546788700196fbeb06afc2e87aa837a51e16a905 /schema | |
parent | 57c7aa0f335d1cfef65646c958b838fd69a9ba5d (diff) |
implement settings profiles (bump schema)
Diffstat (limited to 'schema')
-rw-r--r-- | schema/ttrss_schema_mysql.sql | 16 | ||||
-rw-r--r-- | schema/ttrss_schema_pgsql.sql | 10 | ||||
-rw-r--r-- | schema/versions/mysql/63.sql | 18 | ||||
-rw-r--r-- | schema/versions/pgsql/63.sql | 16 |
4 files changed, 57 insertions, 3 deletions
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index e2f9729aa..862ae3a42 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -15,6 +15,7 @@ drop table if exists ttrss_prefs_types; drop table if exists ttrss_prefs_sections; drop table if exists ttrss_tags; drop table if exists ttrss_enclosures; +drop table if exists ttrss_settings_profiles; drop table if exists ttrss_entry_comments; drop table if exists ttrss_user_entries; drop table if exists ttrss_entries; @@ -238,9 +239,9 @@ create table ttrss_tags (id integer primary key auto_increment, create table ttrss_version (schema_version int not null) TYPE=InnoDB; -insert into ttrss_version values (62); +insert into ttrss_version values (63); -create table ttrss_enclosures (id serial not null primary key, +create table ttrss_enclosures (id integer primary key auto_increment, content_url text not null, content_type varchar(250) not null, post_id integer not null, @@ -249,6 +250,12 @@ create table ttrss_enclosures (id serial not null primary key, index (post_id), foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) TYPE=InnoDB; +create table ttrss_settings_profiles(id integer primary key auto_increment, + title varchar(250) not null, + owner_uid integer not null, + index (owner_uid), + foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB; + create table ttrss_prefs_types (id integer not null primary key, type_name varchar(100) not null) TYPE=InnoDB; @@ -389,10 +396,15 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', '', 1); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_THEME_ID', 3, '0', '', 1); + create table ttrss_user_prefs ( owner_uid integer not null, pref_name varchar(250), value text not null, + 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), diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index f242a6bba..fb2ac1822 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -12,6 +12,7 @@ drop table ttrss_prefs_types; drop table ttrss_prefs_sections; drop table ttrss_tags; drop table ttrss_enclosures; +drop table ttrss_settings_profiles; drop table ttrss_entry_comments; drop table ttrss_user_entries; drop table ttrss_entries; @@ -210,7 +211,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid); create table ttrss_version (schema_version int not null); -insert into ttrss_version values (62); +insert into ttrss_version values (63); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -219,6 +220,10 @@ create table ttrss_enclosures (id serial not null primary key, duration text not null, post_id integer references ttrss_entries(id) ON DELETE cascade NOT NULL); +create table ttrss_settings_profiles(id serial not null primary key, + title varchar(250) not null, + owner_uid integer not null references ttrss_users(id) on delete cascade); + create table ttrss_prefs_types (id integer not null primary key, type_name varchar(100) not null); @@ -355,9 +360,12 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', '', 1); +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_THEME_ID', 3, '0', '', 1); + create table ttrss_user_prefs ( owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE, pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE, + profile integer references ttrss_settings_profiles(id) ON DELETE CASCADE, value text not null); create index ttrss_user_prefs_owner_uid_index on ttrss_user_prefs(owner_uid); diff --git a/schema/versions/mysql/63.sql b/schema/versions/mysql/63.sql new file mode 100644 index 000000000..e5b539906 --- /dev/null +++ b/schema/versions/mysql/63.sql @@ -0,0 +1,18 @@ +begin; + +create table ttrss_settings_profiles(id integer primary key auto_increment, + title varchar(250) not null, + owner_uid integer not null, + index (owner_uid), + foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB; + +alter table ttrss_user_prefs add column profile integer; +update ttrss_user_prefs set profile = NULL; + +alter table ttrss_user_prefs add FOREIGN KEY (profile) REFERENCES ttrss_settings_profiles(id) ON DELETE CASCADE; + +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_THEME_ID', 3, '0', '', 1); + +update ttrss_version set schema_version = 63; + +commit; diff --git a/schema/versions/pgsql/63.sql b/schema/versions/pgsql/63.sql new file mode 100644 index 000000000..90bde3154 --- /dev/null +++ b/schema/versions/pgsql/63.sql @@ -0,0 +1,16 @@ +begin; + +create table ttrss_settings_profiles(id serial not null primary key, + title varchar(250) not null, + owner_uid integer not null references ttrss_users(id) on delete cascade); + +alter table ttrss_user_prefs add column profile integer; +update ttrss_user_prefs set profile = NULL; + +alter table ttrss_user_prefs add constraint "$3" FOREIGN KEY (profile) REFERENCES ttrss_settings_profiles(id) ON DELETE CASCADE; + +insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_THEME_ID', 3, '0', '', 1); + +update ttrss_version set schema_version = 63; + +commit; |