• last updated 6 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
new partial index for a common query

... checking for "approved" members

    • -0
    • +5
    ./postgresql/upgrade/upgrade-5.10.1d13-5.10.1d14.sql
  1. … 1 more file in changeset.
file upgrade-5.10.1d13-5.10.1d14.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d13-5.10.1d14.sql
make update script more robust in case the table acs_privilege_descendant_map was already dropped

The old version worked on pg14, but as it looks, not on earlier pg versions.

    • -1
    • +22
    ./postgresql/upgrade/upgrade-5.10.1d11-5.10.1d12.sql
Cleanup leftover util user messages, that we won't persist anymore

    • -0
    • +6
    ./postgresql/upgrade/upgrade-5.10.1d12-5.10.1d13.sql
  1. … 1 more file in changeset.
file upgrade-5.10.1d12-5.10.1d13.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d12-5.10.1d13.sql
Cleanup of acs_object_context_index' and friends in creation scripts

This change completes the commit [1] from 2019, where the cleanup was performed

acs_object_context_index and its maintenance functions just as an update script.

This change addresses this also in the creation scripts and in packages, still

depending on the old functions.

[1] https://fisheye.openacs.org/changelog/OpenACS?cs=oacs-5-10%3Ahectorr%3A20190708160122

    • -308
    • +1
    ./postgresql/acs-objects-create.sql
    • -250
    • +42
    ./postgresql/acs-permissions-create.sql
    • -0
    • +57
    ./postgresql/upgrade/upgrade-5.10.1d11-5.10.1d12.sql
  1. … 5 more files in changeset.
file upgrade-5.10.1d11-5.10.1d12.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d11-5.10.1d12.sql
file upgrade-5.10.1d9-5.10.1d10.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d9-5.10.1d10.sql
Adjust legacy data types of acs_object_types.object_type and acs_objects.object_type

This change addresses the problem mentioned in

https://cvs.openacs.org/changelog/OpenACS?cs=oacs-5-10%3Agustafn%3A20220729185340

https://github.com/openacs/openacs-core/commit/be44691f06627678122bd913bc3c95c80e93f403

which happens in some legacy applications (such as

e.g. openacs.org) where the data types of the following two

attributes are different.

acs_object_types.object_type

acs_objects.object_type

On new installations (at least concerning the last 10 years) these

data types are the same. So, probably an update script was missing

ages ago.

Since this change affects the basic object structure, MANY views

depend on this datatype and have to be dropped and recreate to

allow the correction of the datatype.

Therefore, we do not want to run this script on all sites, but

only on those where it is necessary.

    • -0
    • +340
    ./postgresql/upgrade/upgrade-5.10.1d9-5.10.1d10.sql
  1. … 1 more file in changeset.
Added membership "expired" to membership states. "expired" can be

used for "dormant" accounts, which are neither "banned" nor "deleted".

    • -0
    • +9
    ./postgresql/upgrade/upgrade-5.10.1d8-5.10.1d9.sql
  1. … 1 more file in changeset.
file upgrade-5.10.1d8-5.10.1d9.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./oracle/upgrade/upgrade-5.10.1d8-5.10.1d9.sql
    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d8-5.10.1d9.sql
Improve robustness of upgrade script for legacy applications

In case, an installation has the legacy view (must be from very old installations)

in place, it is necessary to drop it before registered_users, otherwise

PostgreSQL will complain that it cannot drop view registered_users because

other objects depend on it.

Many thanks to Franz Penz to report this potential problem for old sites.

Align names used in utility db functions in Oracle and PostgreSQL

Over the years, the names used in the function for PostgreSQL and

Oracle drifted away, which is a problem when using call-by-name

convention for stored procedures. Furthermore, recent Oracle versions

do not allow attributes named "table" (for table_name). So the longer

version is now used uniformily. Fortunately, nsf allow abbreviation

for named parameters (like Tcl does), such one can use both

"-table_name" and "-table".

Bumped version number to 5.10.1d7.

    • -0
    • +312
    ./oracle/upgrade/upgrade-5.10.1d6-5.10.1d7.sql
    • -158
    • +157
    ./postgresql/utilities-create.sql
    • -0
    • +167
    ./postgresql/upgrade/upgrade-5.10.1d6-5.10.1d7.sql
  1. … 1 more file in changeset.
file upgrade-5.10.1d6-5.10.1d7.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./oracle/upgrade/upgrade-5.10.1d6-5.10.1d7.sql
    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d6-5.10.1d7.sql
file upgrade-5.10.1d5-5.10.1d6.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d5-5.10.1d6.sql
fix broken function_args definition

    • -0
    • +2
    ./postgresql/upgrade/upgrade-5.10.1d5-5.10.1d6.sql
  1. … 4 more files in changeset.
Fixes for Oracle 19c: uppercase consistently in schema queries

All names in the schema data model are in Oracle in uppercase.

Fixes for Oracle 19c: fixed more cases with Problems with Boolean data types

This fixes e.g. the following problem

[16/Feb/2022:20:55:19][3908.7fa5364fa700][-conn:oacs-5-10-0:default:1:9-] Error: SQL(): nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.foreign_key_exists(table_name => :table_name,column => :column,reftable => :reftable,refcolumn => :refcolumn); END;

[16/Feb/2022:20:55:19][3908.7fa5364fa700][-conn:oacs-5-10-0:default:1:9-] Notice: ### db_with_handle returned error <nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

    • -173
    • +113
    ./oracle/utilities-create.sql
Fixes for Oracle 19c: output potential errors after command

Fixes for Oracle 19c:

- types defined inside an package cannot be used from the outside;

so utility function get_primary_keys() was not usable

- fix various problems with boolean values

Two sample errors raised before the fix:

[16/Feb/2022:16:12:52][20833.7fa027de8940][-main:oacs-5-10-0-] Error: SQL(): nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.table_column_exists(t_name => :t_name,c_name => :c_name); END;

16/Feb/2022:18:16:39][27419.7fb7a518a940][-main:oacs-5-10-0-] Error: SQL(): nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.get_primary_keys(table_name => :table_name); END;

[16/Feb/2022:18:16:39][27419.7fb7a518a940][-main:oacs-5-10-0-] Notice: ### db_with_handle returned error <nsoracle.c:863:OracleExecPLSQLBind: error in 'OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.get_primary_keys(table_name => :table_name); END;> for statement

: #:log "sql=BEGIN :1 := util.get_primary_keys($sql_args); END;, sql_command=ns_ora exec_plsql_bind $db $sql 1 """

: return [ ns_ora exec_plsql_bind $db $sql 1 "" ]

:

Fixes for Oracle 19c for membership and composition triggers

Warning: Trigger created with compilation errors.

Errors for TRIGGER MEMBERSHIP_RELS_IN_TR:

LINE/COL ERROR

-------- -----------------------------------------------------------------

14/3 PL/SQL: SQL Statement ignored

16/3 PL/SQL: ORA-00947: not enough values

32/3 PL/SQL: Statement ignored

32/6 PLS-00201: identifier 'V_COMPOSABLE_P' must be declared

Trigger created.

No errors.

Warning: Trigger created with compilation errors.

Errors for TRIGGER COMPOSITION_RELS_IN_TR:

LINE/COL ERROR

-------- -----------------------------------------------------------------

72/21 PL/SQL: SQL Statement ignored

72/48 PL/SQL: ORA-00918: column ambiguously defined

83/7 PL/SQL: Statement ignored

83/47 PLS-00364: loop index variable 'MEMBERS' use is invalid

86/5 PL/SQL: SQL Statement ignored

91/6 PL/SQL: ORA-00918: column ambiguously defined

Trigger created.

No errors.

The composite_p attribute for acs_object_type.create_type() was missing

This fixes in essence the following errors.

acs_rel_type.create_type (

*

ERROR at line 35:

ORA-06550: line 35, column 2:

PLS-00306: wrong number or types of arguments in call to 'CREATE_TYPE'

ORA-06550: line 35, column 2:

PL/SQL: Statement ignored

ORA-06550: line 54, column 2:

PLS-00306: wrong number or types of arguments in call to 'CREATE_TYPE'

ORA-06550: line 54, column 2:

PL/SQL: Statement ignored

ORA-06550: line 70, column 2:

PLS-00306: wrong number or types of arguments in call to 'CREATE_TYPE'

ORA-06550: line 70, column 2:

PL/SQL: Statement ignored

No errors

insert into group_type_rels

*

ERROR at line 1:

ORA-02291: integrity constraint (OPENACS.GROUP_TYPE_RELS_GROUP_TYPE_FK)

violated - parent key not found

insert into group_type_rels

*

ERROR at line 1:

ORA-02291: integrity constraint (OPENACS.GROUP_TYPE_RELS_GROUP_TYPE_FK)

violated - parent key not found

providing compatibility with Oracle 19c

Either these scripts never worked for Oracle, or these Oracle changed over the years

improving Oracle upgrade scripts

Oracle has no "ALTER TABLE ADD COLUMN ...."

Oracle has no "ALTER TABLE ADD COLUMN if exists .."

  1. … 8 more files in changeset.
Improve spelling

    • -1
    • +1
    ./postgresql/upgrade/upgrade-5.10.0d3-5.10.0d4.sql
    • -1
    • +1
    ./postgresql/upgrade/upgrade-5.9.1d10-5.9.1d11.sql
Fixed update script for applications having the view "upgrade-5.10.0-5.10.1d1.sql" not defined.

This view is a legacy view ancient times, which is no included in standard installations

since ages.... It was however defined on openacs.org.

--

-- Some legacy applications might contain still the VIEW

-- "registered_users_of_package_id", which is defined in

--

-- acs-subsite/sql/postgresql/user-profiles-create.sql

--

-- This file is NOT included in new installations since over 20 years,

-- so it is not maintained and treated as a leftover from ancient

-- times. Therefore, the view registered_users_of_package_id is not

-- recreated by this update script.

    • -7
    • +20
    ./postgresql/upgrade/upgrade-5.10.0-5.10.1d1.sql
refresh also "registered_users_of_package_id", which seems required on some (?) sites

    • -0
    • +10
    ./postgresql/upgrade/upgrade-5.10.0-5.10.1d1.sql
file upgrade-5.10.1d2-5.10.1d3.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./oracle/upgrade/upgrade-5.10.1d2-5.10.1d3.sql
    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d2-5.10.1d3.sql
stick to the original names with the "-" since this is also the naming convention outside of OpenACS (e.g. "scram-sha-256")

    • -2
    • +2
    ./postgresql/community-core-create.sql
    • -0
    • +10
    ./postgresql/upgrade/upgrade-5.10.1d2-5.10.1d3.sql
  1. … 4 more files in changeset.
file upgrade-5.10.1d1-5.10.1d2.sql was initially added on branch oacs-5-10.

    • -0
    • +0
    ./oracle/upgrade/upgrade-5.10.1d1-5.10.1d2.sql
    • -0
    • +0
    ./postgresql/upgrade/upgrade-5.10.1d1-5.10.1d2.sql