From aec57d7ad4a0eb3a62743d54e69e1a4cc3dd74ea Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 26 Jan 2009 10:41:16 +0100 Subject: [PATCH] schema: add ttrss_labels2 color fields (bump schema) --- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 4 +++- schema/ttrss_schema_pgsql.sql | 4 +++- schema/versions/mysql/53.sql | 11 +++++++++++ schema/versions/pgsql/53.sql | 15 +++++++++++++++ 5 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 schema/versions/mysql/53.sql create mode 100644 schema/versions/pgsql/53.sql diff --git a/sanity_check.php b/sanity_check.php index 253d1ae2..c670e01b 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 18); - define('SCHEMA_VERSION', 52); + define('SCHEMA_VERSION', 53); 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 2e775658..f91e09ea 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -224,7 +224,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 (52); +insert into ttrss_version values (53); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -385,6 +385,8 @@ create table ttrss_feedbrowser_cache ( create table ttrss_labels2 (id integer not null primary key auto_increment, owner_uid integer not null, caption varchar(250) not null, + fg_color varchar(15) not null default '', + bg_color varchar(15) not null default '', foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE ) TYPE=InnoDB; diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index f5907210..f42d519c 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -200,7 +200,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 (52); +insert into ttrss_version values (53); create table ttrss_enclosures (id serial not null primary key, content_url text not null, @@ -353,6 +353,8 @@ create table ttrss_feedbrowser_cache ( create table ttrss_labels2 (id serial not null primary key, owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE, + fg_color varchar(15) not null default '', + bg_color varchar(15) not null default '', caption varchar(250) not null ); diff --git a/schema/versions/mysql/53.sql b/schema/versions/mysql/53.sql new file mode 100644 index 00000000..cd96853c --- /dev/null +++ b/schema/versions/mysql/53.sql @@ -0,0 +1,11 @@ +alter table ttrss_labels2 add column fg_color varchar(15); +update ttrss_labels2 set fg_color = ''; +alter table ttrss_labels2 change fg_color fg_color varchar(15) not null; +alter table ttrss_labels2 change fg_color fg_color varchar(15) not default ''; + +alter table ttrss_labels2 add column bg_color varchar(15); +update ttrss_labels2 set bg_color = ''; +alter table ttrss_labels2 change bg_color bg_color varchar(15) not null; +alter table ttrss_labels2 change fg_color bg_color varchar(15) not default ''; + +update ttrss_version set schema_version = 53; diff --git a/schema/versions/pgsql/53.sql b/schema/versions/pgsql/53.sql new file mode 100644 index 00000000..adcf6fde --- /dev/null +++ b/schema/versions/pgsql/53.sql @@ -0,0 +1,15 @@ +begin; + +alter table ttrss_labels2 add column fg_color varchar(15); +update ttrss_labels2 set fg_color = ''; +alter table ttrss_labels2 alter column fg_color set not null; +alter table ttrss_labels2 alter column fg_color set default ''; + +alter table ttrss_labels2 add column bg_color varchar(15); +update ttrss_labels2 set bg_color = ''; +alter table ttrss_labels2 alter column bg_color set not null; +alter table ttrss_labels2 alter column bg_color set default ''; + +update ttrss_version set schema_version = 53; + +commit;