From f7f939b29c44fbc13e567c855bcb2a35e1083030 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 18 Sep 2008 06:02:43 +0100 Subject: [PATCH] alter ttrss_labels.sql_exp to text, bump schema (closes #221) --- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 4 ++-- schema/ttrss_schema_pgsql.sql | 4 ++-- schema/versions/mysql/43.sql | 3 +++ schema/versions/pgsql/43.sql | 7 +++++++ 5 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 schema/versions/mysql/43.sql create mode 100644 schema/versions/pgsql/43.sql diff --git a/sanity_check.php b/sanity_check.php index 82605fd6..5d2f391d 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 17); - define('SCHEMA_VERSION', 42); + define('SCHEMA_VERSION', 43); 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 f8c919e5..9b3ce697 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -188,7 +188,7 @@ create table ttrss_filters (id integer not null primary key auto_increment, create table ttrss_labels (id integer not null primary key auto_increment, owner_uid integer not null, - sql_exp varchar(250) not null, + sql_exp text not null, description varchar(250) not null, index (owner_uid), foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB; @@ -210,7 +210,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 (42); +insert into ttrss_version values (43); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 8801b695..dd419891 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -170,7 +170,7 @@ create table ttrss_filters (id serial not null primary key, create table ttrss_labels (id serial not null primary key, owner_uid integer not null references ttrss_users(id) on delete cascade, - sql_exp varchar(250) not null, + sql_exp text not null, description varchar(250) not null); create index ttrss_labels_owner_uid_index on ttrss_labels(owner_uid); @@ -190,7 +190,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 (42); +insert into ttrss_version values (43); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/versions/mysql/43.sql b/schema/versions/mysql/43.sql new file mode 100644 index 00000000..f1344b20 --- /dev/null +++ b/schema/versions/mysql/43.sql @@ -0,0 +1,3 @@ +alter table ttrss_labels change sql_exp sql_exp text not null; + +update ttrss_version set schema_version = 43; diff --git a/schema/versions/pgsql/43.sql b/schema/versions/pgsql/43.sql new file mode 100644 index 00000000..52bc365c --- /dev/null +++ b/schema/versions/pgsql/43.sql @@ -0,0 +1,7 @@ +alter table ttrss_labels rename column sql_exp to sql_exp_old; +alter table ttrss_labels add column sql_exp text; +update ttrss_labels set sql_exp = sql_exp_old; +alter table ttrss_labels alter column sql_exp set not null; +alter table ttrss_labels drop column sql_exp_old; + +update ttrss_version set schema_version = 43; -- 2.39.5