From eb40e11b14b025f3603581977e2f6bbb032967e4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 10 Dec 2005 08:14:29 +0100 Subject: [PATCH] add column for slash:comments and alike in ttrss_entries (+ add upgrade scripts for 1.1.1) --- schema/ttrss_schema_mysql.sql | 1 + schema/ttrss_schema_pgsql.sql | 1 + schema/upgrade-1.1-1.1.1-mysql.sql | 10 ++++++++++ schema/upgrade-1.1-1.1.1-pgsql.sql | 10 ++++++++++ 4 files changed, 22 insertions(+) create mode 100644 schema/upgrade-1.1-1.1.1-mysql.sql create mode 100644 schema/upgrade-1.1-1.1.1-pgsql.sql diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 6352c2fc..b9855fbd 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -71,6 +71,7 @@ create table ttrss_entries (id integer not null primary key auto_increment, content_hash varchar(250) not null, no_orig_date bool not null default 0, date_entered datetime not null, + num_comments integer not null default 0, comments varchar(250) not null default '') TYPE=InnoDB; create table ttrss_user_entries ( diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index dc4fd5eb..d5849291 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -65,6 +65,7 @@ create table ttrss_entries (id serial not null primary key, content_hash varchar(250) not null, no_orig_date boolean not null default false, date_entered timestamp not null default NOW(), + num_comments integer not null default 0, comments varchar(250) not null default ''); create index ttrss_entries_guid_index on ttrss_entries(guid); diff --git a/schema/upgrade-1.1-1.1.1-mysql.sql b/schema/upgrade-1.1-1.1.1-mysql.sql new file mode 100644 index 00000000..685582b8 --- /dev/null +++ b/schema/upgrade-1.1-1.1.1-mysql.sql @@ -0,0 +1,10 @@ +begin; + +alter table ttrss_entries add column num_comments integer; + +update ttrss_entries set num_comments = 0; + +alter table ttrss_entries change num_comments num_comments integer not null; +alter table ttrss_entries alter column num_comments set default 0; + +commit; diff --git a/schema/upgrade-1.1-1.1.1-pgsql.sql b/schema/upgrade-1.1-1.1.1-pgsql.sql new file mode 100644 index 00000000..9c7b5e35 --- /dev/null +++ b/schema/upgrade-1.1-1.1.1-pgsql.sql @@ -0,0 +1,10 @@ +begin; + +alter table ttrss_entries add column num_comments integer; + +update ttrss_entries set num_comments = 0; + +alter table ttrss_entries alter column num_comments set not null; +alter table ttrss_entries alter column num_comments set default 0; + +commit;