Index: openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-create.sql 31 Jul 2020 12:07:25 -0000 1.3 +++ openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-create.sql 31 Jul 2020 12:36:37 -0000 1.4 @@ -28,8 +28,8 @@ p_public_p alias for $5; p_creation_user alias for $6; p_creation_ip alias for $7; - v_aggregator_id integer; - v_max_item_id integer; + v_aggregator_id integer; + v_max_item_id integer; begin v_aggregator_id := acs_object__new ( p_aggregator_id, @@ -40,27 +40,27 @@ p_package_id ); - select max(item_id) into v_max_item_id - from na_items; - + select max(item_id) into v_max_item_id + from na_items; + insert into na_aggregators ( - aggregator_id, + aggregator_id, aggregator_name, description, maintainer_id, package_id, public_p, - aggregator_bottom + aggregator_bottom ) values ( v_aggregator_id, p_aggregator_name, p_description, p_creation_user, p_package_id, p_public_p, - v_max_item_id + v_max_item_id ); - + PERFORM acs_permission__grant_permission( v_aggregator_id, p_creation_user, @@ -89,14 +89,14 @@ p_aggregator_id alias for $1; v_aggregator_name na_aggregators.aggregator_name%TYPE; begin - select aggregator_name + select aggregator_name into v_aggregator_name from na_aggregators where aggregator_id = p_aggregator_id; return v_aggregator_name; -end;' language 'plpgsql'; +end;' language 'plpgsql'; ---------------- @@ -140,21 +140,21 @@ ); insert into na_sources ( - source_id, - feed_url, - link, - title, - description, - last_scanned, + source_id, + feed_url, + link, + title, + description, + last_scanned, last_modified, listed_p ) values ( v_source_id, - p_feed_url, - p_link, - p_title, + p_feed_url, + p_link, + p_title, p_description, - current_timestamp, + current_timestamp, p_last_modified, p_listed_p ); @@ -179,22 +179,22 @@ begin delete from acs_permissions - where object_id = p_source_id; - - delete from na_purges - where (top in (select item_id - from na_items - where source_id = p_source_id) - or bottom in (select item_id - from na_items - where source_id = p_source_id)); + where object_id = p_source_id; + delete from na_purges + where (top in (select item_id + from na_items + where source_id = p_source_id) + or bottom in (select item_id + from na_items + where source_id = p_source_id)); + delete from na_items where source_id = p_source_id; delete from na_subscriptions where source_id = p_source_id; - + delete from na_sources where source_id = p_source_id; @@ -211,7 +211,7 @@ p_source_id alias for $1; v_source_name na_sources.title%TYPE; begin - select title + select title into v_source_name from na_sources where source_id = p_source_id; @@ -254,23 +254,23 @@ insert into na_items ( source_id, - link, + link, guid, original_guid, permalink_p, - title, + title, description, content_encoded, author, - pub_date, + pub_date, creation_date ) values ( p_source_id, - p_link, + p_link, p_guid, p_original_guid, p_permalink_p, - p_title, + p_title, p_description, p_content_encoded, p_author, @@ -330,21 +330,21 @@ create or replace function na_weblog__new ( integer, -- weblog_id integer, -- package_id - varchar, -- blog_type + varchar, -- blog_type varchar, -- weblog_name varchar, -- base_url integer, -- creation_user varchar -- creation_ip ) returns integer as ' declare - p_weblog_id alias for $1; - p_package_id alias for $2; - p_blog_type alias for $3; - p_weblog_name alias for $4; - p_base_url alias for $5; - p_creation_user alias for $6; - p_creation_ip alias for $7; - v_weblog_id integer; + p_weblog_id alias for $1; + p_package_id alias for $2; + p_blog_type alias for $3; + p_weblog_name alias for $4; + p_base_url alias for $5; + p_creation_user alias for $6; + p_creation_ip alias for $7; + v_weblog_id integer; begin v_weblog_id := acs_object__new ( p_weblog_id, @@ -356,22 +356,22 @@ ); insert into na_weblogs ( - weblog_id, + weblog_id, package_id, blog_type, weblog_name, base_url, user_id ) values ( - v_weblog_id, + v_weblog_id, p_package_id, p_blog_type, p_weblog_name, p_base_url, p_creation_user ); - return v_weblog_id; + return v_weblog_id; end; ' language 'plpgsql'; @@ -387,4 +387,3 @@ return 0; end; ' language 'plpgsql'; - Index: openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-drop.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-drop.sql 31 Jul 2020 12:05:12 -0000 1.4 +++ openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-packages-drop.sql 31 Jul 2020 12:36:37 -0000 1.5 @@ -21,7 +21,7 @@ integer, -- source_id varchar, -- link varchar, -- guid - varchar, -- original_guid + varchar, -- original_guid boolean, -- permalink_p varchar, -- title varchar, -- description Index: openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-tables-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-tables-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-tables-create.sql 31 Jul 2020 12:07:25 -0000 1.5 +++ openacs-4/packages/news-aggregator/sql/postgresql/news-aggregator-tables-create.sql 31 Jul 2020 12:36:37 -0000 1.6 @@ -11,15 +11,15 @@ ---------------- create table na_aggregators ( - aggregator_id integer - constraint na_aggregators_pk - primary key - constraint na_aggregators_aid_fk - references acs_objects(object_id) + aggregator_id integer + constraint na_aggregators_pk + primary key + constraint na_aggregators_aid_fk + references acs_objects(object_id) on delete cascade, - aggregator_name varchar(100) - constraint na_aggregators_name_nn - not null, + aggregator_name varchar(100) + constraint na_aggregators_name_nn + not null, description text, package_id integer constraint na_aggregators_pid_fk @@ -32,7 +32,7 @@ references users(user_id) constraint na_aggregators_mid_nn not null, - public_p boolean default true, + public_p boolean default true, number_shown integer default '100', aggregator_bottom integer @@ -73,15 +73,15 @@ title varchar(500), description varchar(500), updates integer - default '0', + default '0', last_scanned timestamptz - default current_timestamp, + default current_timestamp, last_modified varchar(100), last_modified_stamp timestamptz, - last_scan_ok_p boolean default true, - stacktrace text, - rss_source text, - listed_p boolean default true + last_scan_ok_p boolean default true, + stacktrace text, + rss_source text, + listed_p boolean default true ); @@ -107,63 +107,63 @@ create sequence na_items_item_id_seq cache 1; create table na_items ( - item_id integer + item_id integer default nextval('na_items_item_id_seq') - constraint na_items_pk + constraint na_items_pk primary key, - source_id integer + source_id integer constraint na_items_sid_fk references na_sources(source_id) constraint na_items_sid_nn not null, - link varchar(500), - guid varchar(500), - original_guid varchar(500), - permalink_p boolean + link varchar(500), + guid varchar(500), + original_guid varchar(500), + permalink_p boolean default true, - title varchar(500), - author varchar(100), - comment_page varchar(200), - description text, - content_encoded text, - creation_date timestamptz - default current_timestamp, - pub_date timestamptz + title varchar(500), + author varchar(100), + comment_page varchar(200), + description text, + content_encoded text, + creation_date timestamptz + default current_timestamp, + pub_date timestamptz ); create index na_items_guid_idx on na_items(guid); create index na_items_source_id_idx on na_items(source_id); ALTER TABLE na_items ADD CONSTRAINT na_items_unique_guid UNIQUE (guid,source_id); create table na_saved_items ( - item_id integer - constraint na_saved_items_iid_fk - references na_items(item_id), - aggregator_id integer - constraint na_saved_items_aid_fk - references na_aggregators(aggregator_id) + item_id integer + constraint na_saved_items_iid_fk + references na_items(item_id), + aggregator_id integer + constraint na_saved_items_aid_fk + references na_aggregators(aggregator_id) on delete cascade, - constraint na_saved_items_pk primary key(item_id, aggregator_id) + constraint na_saved_items_pk primary key(item_id, aggregator_id) ); create table na_purges ( - purge_id integer - constraint na_purges_pk - primary key, - top integer - constraint na_purges_top_nn - not null, - bottom integer - constraint na_purges_bottom_nn - not null, - aggregator_id integer - constraint na_purges_aid_fk - references na_aggregators(aggregator_id) - on delete cascade - constraint na_purges_aid_nn - not null, - purge_date timestamptz - default current_timestamp + purge_id integer + constraint na_purges_pk + primary key, + top integer + constraint na_purges_top_nn + not null, + bottom integer + constraint na_purges_bottom_nn + not null, + aggregator_id integer + constraint na_purges_aid_fk + references na_aggregators(aggregator_id) + on delete cascade + constraint na_purges_aid_nn + not null, + purge_date timestamptz + default current_timestamp ); create sequence na_purges_seq; @@ -176,20 +176,20 @@ ---------------- create table na_subscriptions ( - aggregator_id integer + aggregator_id integer constraint na_subscriptions_aid_fk references na_aggregators(aggregator_id) on delete cascade, - source_id integer + source_id integer constraint na_subscriptions_sid_fk references na_sources(source_id), - source_title varchar(100), - show_description_p boolean - constraint na_subscriptions_show_description_p_nn - not null - default true, - creation_date timestamptz - default current_timestamp, + source_title varchar(100), + show_description_p boolean + constraint na_subscriptions_show_description_p_nn + not null + default true, + creation_date timestamptz + default current_timestamp, constraint na_subscriptions_pk primary key (aggregator_id, source_id) ); @@ -202,14 +202,14 @@ ------------------- create table na_user_preferences ( - user_id integer - constraint na_user_prefs_uid_pk - primary key - constraint na_user_prefs_uid_fk - references users(user_id), - default_aggregator integer - constraint na_user_prefs_default_fk - references na_aggregators(aggregator_id) + user_id integer + constraint na_user_prefs_uid_pk + primary key + constraint na_user_prefs_uid_fk + references users(user_id), + default_aggregator integer + constraint na_user_prefs_default_fk + references na_aggregators(aggregator_id) on delete set null ); @@ -245,24 +245,24 @@ ------------------- select acs_object_type__create_type ( - 'na_weblog', -- object_type - 'News Aggregator Weblog', -- pretty_name - 'News Aggregator Weblogs', -- pretty_plural - 'acs_object', -- supertype - 'na_weblogs', -- table_name - 'weblog_id', -- id_column - 'news-aggregator', -- package_name - 'f', -- abstract_p - null, -- type_extension_table - 'na_weblog__name' -- name_method + 'na_weblog', -- object_type + 'News Aggregator Weblog', -- pretty_name + 'News Aggregator Weblogs', -- pretty_plural + 'acs_object', -- supertype + 'na_weblogs', -- table_name + 'weblog_id', -- id_column + 'news-aggregator', -- package_name + 'f', -- abstract_p + null, -- type_extension_table + 'na_weblog__name' -- name_method ); create table na_weblogs ( weblog_id integer constraint na_weblogs_weblog_id_fk - references acs_objects(object_id) - constraint na_weblogs_weblog_id_nn - not null, + references acs_objects(object_id) + constraint na_weblogs_weblog_id_nn + not null, package_id integer constraint na_weblogs_pid_fk references apm_packages(package_id) @@ -279,9 +279,9 @@ blog_type varchar(100) constraint na_weblogs_blog_type_nn not null, - base_url varchar(500) - constraint na_weblogs_base_url_nn - not null, + base_url varchar(500) + constraint na_weblogs_base_url_nn + not null, server varchar(500), port integer, path varchar(100),