diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 6352c2fcc..b9855fbd6 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 dc4fd5eb8..d58492919 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 000000000..685582b89 --- /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 000000000..9c7b5e35d --- /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;