Index: openacs-4/packages/acs-kernel/acs-kernel.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v
diff -u -r1.129.2.14 -r1.129.2.15
--- openacs-4/packages/acs-kernel/acs-kernel.info 13 Sep 2014 09:47:38 -0000 1.129.2.14
+++ openacs-4/packages/acs-kernel/acs-kernel.info 19 Sep 2014 20:19:44 -0000 1.129.2.15
@@ -7,15 +7,15 @@
t
t
-
+
OpenACS Core Team
Routines and data models providing the foundation for OpenACS-based Web services.
2013-09-08
OpenACS
The OpenACS kernel contains the core datamodel create and drop scripts for such things as objects, groups, partiies and the supporting PL/SQL and PL/pgSQL procedures.
3
-
+
Index: openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql,v
diff -u -r1.2 -r1.2.20.1
--- openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql 15 Dec 2003 01:50:39 -0000 1.2
+++ openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql 19 Sep 2014 20:19:44 -0000 1.2.20.1
@@ -18,6 +18,23 @@
function logical_negation (
true_or_false IN varchar2)
return varchar2;
+
+ function table_exists (
+ name in varchar2)
+ return boolean;
+
+ function table_column_exists (
+ t_name in varchar2,
+ c_name in varchar2)
+ return boolean;
+
+ function view_exists (
+ name in varchar2)
+ return boolean;
+
+ function index_exists (
+ name in varchar2)
+ return boolean;
end util;
/
show errors
@@ -60,6 +77,39 @@
return 'f';
END IF;
END logical_negation;
+
+ function table_exists (
+ name IN varchar2)
+ return boolean
+ as
+ begin
+ return exists (select 1 from user_tables where table_name = t_name);
+ END table_exists;
+
+ function table_column_exists (
+ t_name IN varchar2,
+ c_name IN varchar2)
+ return boolean
+ as
+ begin
+ return exists (select 1 from user_tab_columns where c.table_name = t_name and c.column_name = c_name);
+ END table_column_exists;
+
+ function view_exists (
+ name IN varchar2)
+ return boolean
+ as
+ begin
+ return exists (select 1 from user_views where view_name = name);
+ END view_exists;
+
+ function index_exists (
+ name IN varchar2)
+ return boolean
+ as
+ begin
+ return exists (select 1 from user_indexes where index_name = name);
+ END index_exists;
end util;
/
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.8.1d6-5.8.1d7.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql 7 Jul 2011 10:46:02 -0000 1.7
+++ openacs-4/packages/acs-kernel/sql/postgresql/utilities-create.sql 19 Sep 2014 20:19:44 -0000 1.7.2.1
@@ -61,3 +61,78 @@
$$ LANGUAGE plpgsql immutable strict;
+-- added
+select define_function_args('util__table_exists','name');
+
+--
+-- procedure util__table_exists/1
+--
+CREATE OR REPLACE FUNCTION util__table_exists(
+ name text
+) RETURNS boolean AS $$
+DECLARE
+BEGIN
+ return exists (
+ select 1 from pg_class
+ where relname = name
+ and pg_table_is_visible(oid));
+END;
+$$ LANGUAGE plpgsql;
+
+
+-- added
+select define_function_args('util__table_column_exists','t_name,c_name');
+
+--
+-- procedure util__table_column_exists/1
+--
+CREATE OR REPLACE FUNCTION util__table_column_exists(
+ t_name text,
+ c_name text
+) RETURNS boolean AS $$
+DECLARE
+BEGIN
+ return exists (
+ select 1 from information_schema.columns c
+ where c.table_name = t_name
+ and c.column_name = c_name);
+END;
+$$ LANGUAGE plpgsql;
+
+
+-- added
+select define_function_args('util__view_exists','name');
+
+--
+-- procedure util__view_exists/1
+--
+CREATE OR REPLACE FUNCTION util__view_exists(
+ name text
+) RETURNS boolean AS $$
+DECLARE
+BEGIN
+ return exists (
+ select 1 from pg_views where viewname = name);
+END;
+$$ LANGUAGE plpgsql;
+
+
+-- added
+select define_function_args('util__index_exists','name');
+
+--
+-- procedure util__index_exists/1
+--
+CREATE OR REPLACE FUNCTION util__index_exists(
+ name text
+) RETURNS boolean AS $$
+DECLARE
+BEGIN
+ return exists (
+ select 1 from pg_indexes where indexname = name);
+END;
+$$ LANGUAGE plpgsql;
+
+
+
+
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.8.1d6-5.8.1d7.sql'.
Fisheye: No comparison available. Pass `N' to diff?