From 2b6ed06b23041812d0319e5146426c06cbb50459 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 30 Jan 2008 11:54:16 +0100 Subject: [PATCH] schema: add ttrss_prefs.access_level, bump version --- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 3 ++- schema/ttrss_schema_pgsql.sql | 3 ++- schema/versions/mysql/32.sql | 6 ++++++ schema/versions/pgsql/32.sql | 6 ++++++ 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 schema/versions/mysql/32.sql create mode 100644 schema/versions/pgsql/32.sql diff --git a/sanity_check.php b/sanity_check.php index 0a6b9a36..2a7c07a1 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 15); - define('SCHEMA_VERSION', 31); + define('SCHEMA_VERSION', 32); if (!file_exists("config.php")) { print __("Fatal Error: You forgot to copy diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 240961d0..04f74028 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -205,7 +205,7 @@ 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 (31); +insert into ttrss_version values (32); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -235,6 +235,7 @@ create table ttrss_prefs (pref_name varchar(250) not null primary key, section_id integer not null default 1, short_desc text not null, help_text varchar(250) not null default '', + access_level integer not null default 0, def_value text not null, index(type_id), foreign key (type_id) references ttrss_prefs_types(id), diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 8ffce351..228ce526 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -184,7 +184,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 (31); +insert into ttrss_version values (32); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -212,6 +212,7 @@ create table ttrss_prefs (pref_name varchar(250) not null primary key, section_id integer not null references ttrss_prefs_sections(id) default 1, short_desc text not null, help_text text not null default '', + access_level integer not null default 0, def_value text not null); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_ICONS', 1, 'true', 'Enable icons in feedlist',3); diff --git a/schema/versions/mysql/32.sql b/schema/versions/mysql/32.sql new file mode 100644 index 00000000..689e5072 --- /dev/null +++ b/schema/versions/mysql/32.sql @@ -0,0 +1,6 @@ +alter table ttrss_prefs add column access_level integer; +update ttrss_prefs set access_level = 0; +alter table ttrss_prefs change access_level access_level integer not null; +alter table ttrss_prefs alter column access_level set default 0; + +update ttrss_version set schema_version = 32; diff --git a/schema/versions/pgsql/32.sql b/schema/versions/pgsql/32.sql new file mode 100644 index 00000000..30565555 --- /dev/null +++ b/schema/versions/pgsql/32.sql @@ -0,0 +1,6 @@ +alter table ttrss_prefs add column access_level integer; +update ttrss_prefs set access_level = 0; +alter table ttrss_prefs alter column access_level set not null; +alter table ttrss_prefs alter column access_level set default 0; + +update ttrss_version set schema_version = 32;