From 567810362c08bb66a81435a9280d34efec9a628f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 18 Nov 2010 12:56:21 +0300 Subject: [PATCH] schema: add ttrss_feeds.order_id --- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 3 ++- schema/ttrss_schema_pgsql.sql | 3 ++- schema/versions/mysql/75.sql | 10 ++++++++++ schema/versions/pgsql/75.sql | 10 ++++++++++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 schema/versions/mysql/75.sql create mode 100644 schema/versions/pgsql/75.sql diff --git a/sanity_check.php b/sanity_check.php index 7e792f379..4b77e92bb 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 20); - define('SCHEMA_VERSION', 74); + define('SCHEMA_VERSION', 75); 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 adf158c6f..9e65442a5 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -114,6 +114,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key, last_update_started datetime default null, always_display_enclosures boolean not null default false, update_method integer not null default 0, + order_id integer not null default 0, index(owner_uid), foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, index(cat_id), @@ -246,7 +247,7 @@ create table ttrss_tags (id integer primary key auto_increment, create table ttrss_version (schema_version int not null) TYPE=InnoDB DEFAULT CHARSET=UTF8; -insert into ttrss_version values (74); +insert into ttrss_version values (75); create table ttrss_enclosures (id integer primary key auto_increment, content_url text not null, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index dd62d17b0..d8fab88eb 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -83,6 +83,7 @@ create table ttrss_feeds (id serial not null primary key, last_update_started timestamp default null, update_method integer not null default 0, always_display_enclosures boolean not null default false, + order_id integer not null default 0, auth_pass_encrypted boolean not null default false); create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid); @@ -221,7 +222,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id); create table ttrss_version (schema_version int not null); -insert into ttrss_version values (74); +insert into ttrss_version values (75); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/versions/mysql/75.sql b/schema/versions/mysql/75.sql new file mode 100644 index 000000000..c9017b9e9 --- /dev/null +++ b/schema/versions/mysql/75.sql @@ -0,0 +1,10 @@ +begin; + +alter table ttrss_feeds add column order_id integer; +update ttrss_feeds set order_id = 0; +alter table ttrss_feeds change order_id order_id integer not null; +alter table ttrss_feeds alter column order_id set default 0; + +update ttrss_version set schema_version = 75; + +commit; diff --git a/schema/versions/pgsql/75.sql b/schema/versions/pgsql/75.sql new file mode 100644 index 000000000..3291d652c --- /dev/null +++ b/schema/versions/pgsql/75.sql @@ -0,0 +1,10 @@ +begin; + +alter table ttrss_feeds add column order_id integer; +update ttrss_feeds set order_id = 0; +alter table ttrss_feeds alter column order_id set not null; +alter table ttrss_feeds alter column order_id set default 0; + +update ttrss_version set schema_version = 75; + +commit;