From 4bc760da51ebb36a13edf8b34d3efee0276abaf6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Feb 2006 07:39:09 +0100 Subject: [PATCH] add author column to ttrss_entries, add upgrade script for 1.1.4, bump schema version --- schema/{ => obsolete}/upgrade-1.1.2-1.1.3-mysql.sql | 0 schema/{ => obsolete}/upgrade-1.1.2-1.1.3-pgsql.sql | 0 schema/ttrss_schema_mysql.sql | 3 ++- schema/ttrss_schema_pgsql.sql | 3 ++- schema/upgrade-1.1.3-1.1.4-mysql.sql | 9 +++++++++ schema/upgrade-1.1.3-1.1.4-pgsql.sql | 12 ++++++++++++ 6 files changed, 25 insertions(+), 2 deletions(-) rename schema/{ => obsolete}/upgrade-1.1.2-1.1.3-mysql.sql (100%) rename schema/{ => obsolete}/upgrade-1.1.2-1.1.3-pgsql.sql (100%) create mode 100644 schema/upgrade-1.1.3-1.1.4-mysql.sql create mode 100644 schema/upgrade-1.1.3-1.1.4-pgsql.sql diff --git a/schema/upgrade-1.1.2-1.1.3-mysql.sql b/schema/obsolete/upgrade-1.1.2-1.1.3-mysql.sql similarity index 100% rename from schema/upgrade-1.1.2-1.1.3-mysql.sql rename to schema/obsolete/upgrade-1.1.2-1.1.3-mysql.sql diff --git a/schema/upgrade-1.1.2-1.1.3-pgsql.sql b/schema/obsolete/upgrade-1.1.2-1.1.3-pgsql.sql similarity index 100% rename from schema/upgrade-1.1.2-1.1.3-pgsql.sql rename to schema/obsolete/upgrade-1.1.2-1.1.3-pgsql.sql diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index a8fb8698..eb107699 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -83,7 +83,8 @@ create table ttrss_entries (id integer not null primary key auto_increment, 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; + comments varchar(250) not null default '', + author varchar(250) not null default '') TYPE=InnoDB; create table ttrss_user_entries ( int_id integer not null primary key auto_increment, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index b9398450..97434ce2 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -75,7 +75,8 @@ create table ttrss_entries (id serial not null primary key, 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 ''); + comments varchar(250) not null default '', + author varchar(250) not null default ''); create index ttrss_entries_guid_index on ttrss_entries(guid); create index ttrss_entries_title_index on ttrss_entries(title); diff --git a/schema/upgrade-1.1.3-1.1.4-mysql.sql b/schema/upgrade-1.1.3-1.1.4-mysql.sql new file mode 100644 index 00000000..a4e2e7ab --- /dev/null +++ b/schema/upgrade-1.1.3-1.1.4-mysql.sql @@ -0,0 +1,9 @@ +alter table ttrss_entries add column author varchar(250); + +update ttrss_entries set author = ;;; + +alter table ttrss_entries change author author varchar(250) not null; +alter table ttrss_entries alter column author set default ''; + +update ttrss_version set schema_version = 6; + diff --git a/schema/upgrade-1.1.3-1.1.4-pgsql.sql b/schema/upgrade-1.1.3-1.1.4-pgsql.sql new file mode 100644 index 00000000..92025c4a --- /dev/null +++ b/schema/upgrade-1.1.3-1.1.4-pgsql.sql @@ -0,0 +1,12 @@ +begin; + +alter table ttrss_entries add column author varchar(250); + +update ttrss_entries set author = ''; + +alter table ttrss_entries alter column author set not null; +alter table ttrss_entries alter column author set default ''; + +update ttrss_version set schema_version = 6; + +commit; -- 2.39.5