From f574fec6a6cd32f8c1582399cb4796974327df96 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 11 May 2009 23:32:16 +0400 Subject: [PATCH] workaround against ttrss_enclosures mysql data being wrong (nukes the enclosures table) --- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 2 +- schema/ttrss_schema_pgsql.sql | 2 +- schema/versions/mysql/56.sql | 16 ++++++++++++++++ schema/versions/pgsql/56.sql | 5 +++++ 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 schema/versions/mysql/56.sql create mode 100644 schema/versions/pgsql/56.sql diff --git a/sanity_check.php b/sanity_check.php index 51dc1b5f..ab4e29b3 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', 55); + define('SCHEMA_VERSION', 56); 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 abeb30ec..ba9e8d43 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -225,7 +225,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 (55); +insert into ttrss_version values (56); 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 57d2e95d..830b8da6 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -201,7 +201,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 (55); +insert into ttrss_version values (56); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/versions/mysql/56.sql b/schema/versions/mysql/56.sql new file mode 100644 index 00000000..af2fb820 --- /dev/null +++ b/schema/versions/mysql/56.sql @@ -0,0 +1,16 @@ +begin; + +drop table ttrss_enclosures; + +create table ttrss_enclosures (id serial not null primary key, + content_url text not null, + content_type varchar(250) not null, + post_id integer not null, + title text not null, + duration text not null, + index (post_id), + foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) TYPE=InnoDB; + +update ttrss_version set schema_version = 56; + +commit; diff --git a/schema/versions/pgsql/56.sql b/schema/versions/pgsql/56.sql new file mode 100644 index 00000000..d6d57f03 --- /dev/null +++ b/schema/versions/pgsql/56.sql @@ -0,0 +1,5 @@ +begin; + +update ttrss_version set schema_version = 56; + +commit; -- 2.39.5