Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql,v diff -u -r1.35 -r1.36 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 4 Jun 2006 00:45:38 -0000 1.35 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 25 Sep 2006 17:59:16 -0000 1.36 @@ -8,7 +8,7 @@ create table acs_magic_objects ( name varchar(100) - constraint acs_magic_objects_pk primary key, + constraint acs_magic_objects_name_pk primary key, object_id integer not null constraint acs_magic_objects_object_id_fk references acs_objects(object_id) ); Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-logs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-logs-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-logs-create.sql 18 Jun 2004 18:21:57 -0000 1.5 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-logs-create.sql 25 Sep 2006 17:59:16 -0000 1.6 @@ -12,7 +12,7 @@ create table acs_logs ( log_id integer - constraint acs_logs_pk + constraint acs_logs_log_id_pk primary key, log_date timestamptz default current_timestamp not null, log_level varchar(20) not null Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql,v diff -u -r1.24 -r1.25 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql 24 Sep 2006 11:45:08 -0000 1.24 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql 25 Sep 2006 17:59:16 -0000 1.25 @@ -263,9 +263,9 @@ create table acs_datatypes ( datatype varchar(50) not null - constraint acs_datatypes_pk primary key, + constraint acs_datatypes_datatype_pk primary key, max_n_values integer default 1 - constraint acs_datatypes_max_n_ck + constraint acs_datatypes_max_n_values_ck check (max_n_values > 0) ); @@ -364,7 +364,7 @@ create table acs_attributes ( attribute_id integer not null - constraint acs_attributes_pk + constraint acs_attributes_attribute_id_pk primary key, object_type varchar(100) not null constraint acs_attributes_object_type_fk @@ -382,10 +382,10 @@ references acs_datatypes (datatype), default_value text, min_n_values integer default 1 not null - constraint acs_attributes_min_n_ck + constraint acs_attributes_min_n_values_ck check (min_n_values >= 0), max_n_values integer default 1 not null - constraint acs_attributes_max_n_ck + constraint acs_attributes_max_n_values_ck check (max_n_values >= 0), storage varchar(13) default 'type_specific' constraint acs_attributes_storage_ck Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql,v diff -u -r1.54 -r1.55 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 27 Feb 2005 19:23:01 -0000 1.54 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 25 Sep 2006 17:59:16 -0000 1.55 @@ -206,7 +206,7 @@ create table acs_objects ( object_id integer not null - constraint acs_objects_pk primary key, + constraint acs_objects_object_id_pk primary key, object_type varchar(100) not null constraint acs_objects_object_type_fk references acs_object_types (object_type), @@ -1584,7 +1584,7 @@ object_id integer not null constraint general_objects_object_id_fk references acs_objects (object_id) - constraint general_objects_pk + constraint general_objects_object_id_pk primary key, on_which_table varchar(30) not null, on_what_id integer not null, Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql,v diff -u -r1.29 -r1.30 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql 27 Feb 2005 01:21:07 -0000 1.29 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql 25 Sep 2006 17:59:16 -0000 1.30 @@ -19,7 +19,7 @@ --------------------------------------------- create table acs_privileges ( - privilege varchar(100) not null constraint acs_privileges_pk + privilege varchar(100) not null constraint acs_privileges_privilege_pk primary key, pretty_name varchar(100), pretty_plural varchar(100) @@ -335,15 +335,15 @@ create table acs_permissions ( object_id integer not null - constraint acs_permissions_on_what_id_fk + constraint acs_permissions_object_id_fk references acs_objects (object_id) on delete cascade, grantee_id integer not null constraint acs_permissions_grantee_id_fk references parties (party_id) on delete cascade, privilege varchar(100) not null - constraint acs_permissions_priv_fk + constraint acs_permissions_privilege_fk references acs_privileges (privilege) on delete cascade, constraint acs_permissions_pk Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql 4 Jun 2006 00:45:38 -0000 1.22 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql 25 Sep 2006 17:59:16 -0000 1.23 @@ -16,20 +16,20 @@ create table acs_rel_roles ( role varchar(100) not null - constraint acs_rel_roles_pk primary key, + constraint acs_rel_roles_role_pk primary key, pretty_name varchar(100) not null, pretty_plural varchar(100) not null ); create table acs_rel_types ( rel_type varchar(100) not null - constraint acs_rel_types_pk primary key + constraint acs_rel_types_rel_type_pk primary key constraint acs_rel_types_rel_type_fk references acs_object_types(object_type), object_type_one varchar(100) not null constraint acs_rel_types_obj_type_1_fk references acs_object_types (object_type), - role_one varchar(100) constraint acs_rel_types_role_1_fk + role_one varchar(100) constraint acs_rel_types_role_one_fk references acs_rel_roles (role), min_n_rels_one integer default 0 not null constraint acs_rel_types_min_n_1_ck @@ -40,7 +40,7 @@ object_type_two varchar(100) not null constraint acs_rel_types_obj_type_2_fk references acs_object_types (object_type), - role_two varchar(100) constraint acs_rel_types_role_2_fk + role_two varchar(100) constraint acs_rel_types_role_two_fk references acs_rel_roles (role), min_n_rels_two integer default 0 not null constraint acs_rel_types_min_n_2_ck @@ -323,16 +323,16 @@ constraint acs_rels_rel_id_fk references acs_objects (object_id) on delete cascade - constraint acs_rels_pk primary key, + constraint acs_rels_rel_id_pk primary key, rel_type varchar(100) not null constraint acs_rels_rel_type_fk references acs_rel_types (rel_type), object_id_one integer not null - constraint acs_object_rels_one_fk + constraint acs_rels_object_id_one_fk references acs_objects (object_id) on delete cascade, object_id_two integer not null - constraint acs_object_rels_two_fk + constraint acs_rels_object_id_two_fk references acs_objects (object_id) on delete cascade, constraint acs_object_rels_un unique @@ -369,13 +369,13 @@ create table acs_data_links ( rel_id integer not null - constraint acs_data_links_pk primary key, + constraint acs_data_links_rel_id_pk primary key, object_id_one integer not null - constraint acs_data_links_one_fk + constraint acs_data_links_obj_one_fk references acs_objects (object_id) on delete cascade, object_id_two integer not null - constraint acs_data_links_two_fk + constraint acs_data_links_obj_two_fk references acs_objects (object_id) on delete cascade, constraint acs_data_links_un unique Index: openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql,v diff -u -r1.65 -r1.66 --- openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql 24 Sep 2006 09:26:36 -0000 1.65 +++ openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql 25 Sep 2006 17:59:16 -0000 1.66 @@ -136,11 +136,11 @@ create table apm_packages ( package_id integer constraint apm_packages_package_id_fk references acs_objects(object_id) - constraint apm_packages_pack_id_pk primary key, + constraint apm_packages_package_id_pk primary key, package_key varchar(100) constraint apm_packages_package_key_fk references apm_package_types(package_key), instance_name varchar(300) - constraint apm_packages_inst_name_nn not null, + constraint apm_packages_instance_name_nn not null, -- default system locale for this package default_locale varchar(30) ); @@ -671,26 +671,26 @@ '; create table apm_parameters ( - parameter_id integer constraint apm_parameters_fk + parameter_id integer constraint apm_parameters_parameter_id_fk references acs_objects(object_id) - constraint apm_parameters_pk primary key, + constraint apm_parameters_parameter_id_pk primary key, package_key varchar(100) - constraint apm_pack_param_pack_key_nn not null - constraint apm_pack_param_type_fk + constraint apm_parameters_package_key_nn not null + constraint apm_parameters_package_key_fk references apm_package_types (package_key), parameter_name varchar(100) constraint apm_pack_params_name_nn not null, description varchar(2000), section_name varchar(200), datatype varchar(100) not null - constraint apm_parameter_datatype_ck + constraint apm_parameters_datatype_ck check(datatype in ('number', 'string')), default_value text, min_n_values integer default 1 not null - constraint apm_paramters_min_n_ck + constraint apm_parameters_min_n_values_ck check (min_n_values >= 0), max_n_values integer default 1 not null - constraint apm_paramters_max_n_ck + constraint apm_parameters_max_n_values_ck check (max_n_values >= 0), constraint apm_paramters_attr_name_un unique (parameter_name, package_key), @@ -743,9 +743,9 @@ value_id integer constraint apm_parameter_values_fk references acs_objects(object_id) constraint apm_parameter_values_pk primary key, - package_id integer constraint apm_pack_values_obj_id_fk + package_id integer constraint apm_parameter_values_pk_id_fk references apm_packages (package_id) on delete cascade, - parameter_id integer constraint apm_pack_values_parm_id_fk + parameter_id integer constraint apm_parameter_values_pm_id_fk references apm_parameters (parameter_id), attr_value text, constraint apm_parameter_values_un @@ -991,9 +991,9 @@ create table apm_applications ( application_id integer - constraint applications_application_id_fk + constraint apm_applications_aplt_id_fk references apm_packages(package_id) - constraint applications_pk primary key + constraint apm_applications_pk primary key ); comment on table apm_applications is ' @@ -1003,9 +1003,9 @@ create table apm_services ( service_id integer - constraint services_service_id_fk + constraint apm_services_service_id_fk references apm_packages(package_id) - constraint services_pk primary key + constraint apm_services_service_id_pk primary key ); comment on table apm_services is ' Index: openacs-4/packages/acs-kernel/sql/postgresql/authentication-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/authentication-create.sql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-kernel/sql/postgresql/authentication-create.sql 1 Jul 2004 11:29:17 -0000 1.13 +++ openacs-4/packages/acs-kernel/sql/postgresql/authentication-create.sql 25 Sep 2006 17:59:16 -0000 1.14 @@ -12,52 +12,52 @@ create table auth_authorities ( authority_id integer - constraint auth_authorities_pk + constraint auth_authorities_auth_id_pk primary key - constraint auth_authorities_aid_fk + constraint auth_authorities_auth_id_fk references acs_objects(object_id) on delete cascade, short_name varchar(255) - constraint auth_authority_short_name_un + constraint auth_authorities_short_name_un unique, pretty_name varchar(4000), help_contact_text varchar(4000), help_contact_text_format varchar(200), enabled_p boolean default 't' - constraint auth_authority_enabled_p_nn + constraint auth_authorities_enbl_p_nn not null, sort_order integer not null, -- auth_authentication implementation -- (Cannot reference acs_sc_impls table as it doesn't exist yet) auth_impl_id integer - constraint auth_authority_auth_impl_fk + constraint auth_authorities_auth_impl_fk references acs_objects(object_id), -- auth_password implementation pwd_impl_id integer - constraint auth_authority_pwd_impl_fk + constraint auth_authorities_pwd_impl_fk references acs_objects(object_id), forgotten_pwd_url varchar(4000), change_pwd_url varchar(4000), -- auth_registration implementation register_impl_id integer - constraint auth_authority_reg_impl_fk + constraint auth_authorities_reg_impl_fk references acs_objects(object_id), register_url varchar(4000), -- auth_user_info implementation user_info_impl_id integer - constraint auth_authority_userinf_impl_fk + constraint auth_authorities_urinf_ipl_fk references acs_objects(object_id), -- batch sync -- auth_sync_retrieve implementation get_doc_impl_id integer - constraint auth_authority_getdoc_impl_fk + constraint auth_authorities_getdoc_ipl_fk references acs_objects(object_id), -- auth_sync_process implementation process_doc_impl_id integer - constraint auth_authority_procdoc_impl_fk + constraint auth_authorities_procdoc_ipl_fk references acs_objects(object_id), batch_sync_enabled_p boolean default 'f' - constraint auth_authority_bs_enabled_p_nn + constraint auth_authorities_bsenabled_p_nn not null ); @@ -98,10 +98,10 @@ constraint auth_driver_params_aid_nn not null, impl_id integer - constraint auth_driver_params_iid_fk + constraint auth_driver_params_impl_id_fk -- Cannot reference acs_sc_impls table as it doesn't exist yet references acs_objects(object_id) - constraint auth_driver_params_iid_nn + constraint auth_driver_params_impl_id_nn not null, key varchar(200), value text, Index: openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql 11 Aug 2006 21:58:04 -0000 1.23 +++ openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql 25 Sep 2006 17:59:16 -0000 1.24 @@ -249,7 +249,7 @@ party_id integer not null constraint parties_party_id_fk references acs_objects (object_id) - constraint parties_pk primary key, + constraint parties_party_id_pk primary key, email varchar(100) constraint parties_email_un unique, url varchar(200) @@ -342,7 +342,7 @@ person_id integer not null constraint persons_person_id_fk references parties (party_id) - constraint persons_pk primary key, + constraint persons_person_id_pk primary key, first_names varchar(100) not null, last_name varchar(100) not null ); @@ -485,9 +485,9 @@ user_id integer not null constraint users_user_id_fk references persons (person_id) - constraint users_pk primary key, + constraint users_user_id_pk primary key, authority_id integer - constraint users_auth_authorities_fk + constraint users_authority_id_fk references auth_authorities(authority_id), username varchar(100) constraint users_username_nn @@ -520,9 +520,9 @@ create index users_screenname_lower_idx on users(lower(screen_name)); create table user_preferences ( - user_id integer constraint user_prefs_user_id_fk + user_id integer constraint user_preferences_user_id_fk references users (user_id) - constraint user_preferences_pk + constraint user_preferences_user_id_pk primary key, prefer_text_only_p boolean default 'f', -- an ISO 639 language code (in lowercase) Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql 11 Aug 2006 21:58:04 -0000 1.23 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql 25 Sep 2006 17:59:16 -0000 1.24 @@ -17,30 +17,30 @@ -- the "DENORMALIZATION" section further below). create table composition_rels ( - rel_id integer constraint composition_rel_rel_id_fk + rel_id integer constraint composition_rels_rel_id_fk references acs_rels (rel_id) on delete cascade - constraint composition_rel_rel_id_pk + constraint composition_rels_rel_id_pk primary key ); create table membership_rels ( - rel_id integer constraint membership_rel_rel_id_fk + rel_id integer constraint membership_rels_rel_id_fk references acs_rels (rel_id) on delete cascade - constraint membership_rel_rel_id_pk + constraint membership_rels_rel_id_pk primary key, -- null means waiting for admin approval - member_state varchar(20) constraint membership_rel_mem_ck + member_state varchar(20) constraint membership_rels_member_state_ck check (member_state in ('merged', 'approved', 'needs approval', 'banned', 'rejected', 'deleted')) ); create table admin_rels ( - rel_id integer constraint admin_rel_rel_id_fk + rel_id integer constraint admin_rels_rel_id_fk references membership_rels (rel_id) on delete cascade - constraint admin_rel_rel_id_pk + constraint admin_rels_rel_id_pk primary key ); @@ -164,13 +164,13 @@ create table group_types ( group_type varchar(400) not null - constraint group_types_pk primary key - constraint group_types_obj_type_fk + constraint group_types_group_type_pk primary key + constraint group_types_group_type_fk references acs_object_types (object_type), -- commented out by Ben (OpenACS), to make it in sync with Oracle version.. -- approval_policy varchar(30) not null, default_join_policy varchar(30) default 'open' not null - constraint group_types_join_policy_ck + constraint group_types_join_dft_policy_ck check (default_join_policy in ('open', 'needs approval', 'closed')) ); @@ -184,7 +184,7 @@ group_id integer not null constraint groups_group_id_fk references parties (party_id) - constraint groups_pk primary key, + constraint groups_group_id_pk primary key, group_name varchar(1000) not null, join_policy varchar(30) default 'open' not null constraint groups_join_policy_ck @@ -197,11 +197,11 @@ create table group_type_rels ( group_rel_type_id integer constraint gtr_group_rel_type_id_pk primary key, rel_type varchar(100) not null - constraint gtr_rel_type_fk + constraint group_type_rels_rel_type_fk references acs_rel_types (rel_type) on delete cascade, group_type varchar(100) not null - constraint gtr_group_type_fk + constraint group_type_rels_group_type_fk references acs_object_types (object_type) on delete cascade, constraint gtr_group_rel_types_un unique (group_type, rel_type) @@ -292,7 +292,7 @@ references acs_rel_types (rel_type) on delete cascade, ancestor_rel_type varchar(100) not null - constraint grp_el_idx_ancstr_rel_type_ck + constraint group_element_index_ant_rt_ck check (ancestor_rel_type in ('composition_rel','membership_rel')), constraint group_element_index_pk primary key (element_id, group_id, rel_id) Index: openacs-4/packages/acs-kernel/sql/postgresql/journal-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/journal-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-kernel/sql/postgresql/journal-create.sql 18 Jun 2004 18:21:57 -0000 1.9 +++ openacs-4/packages/acs-kernel/sql/postgresql/journal-create.sql 25 Sep 2006 17:59:16 -0000 1.10 @@ -42,10 +42,10 @@ create table journal_entries ( journal_id integer constraint journal_entries_journal_id_fk references acs_objects (object_id) - constraint journal_entries_pk + constraint journal_entries_journal_id_pk primary key, object_id integer - constraint journal_entries_object_fk + constraint journal_entries_object_id_fk references acs_objects on delete cascade, action varchar(100), action_pretty text, Index: openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql 4 Jun 2006 00:45:38 -0000 1.15 +++ openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql 25 Sep 2006 17:59:16 -0000 1.16 @@ -52,16 +52,16 @@ references acs_objects(object_id), constraint_name varchar(100) not null, rel_segment integer not null - constraint rc_rel_segment_fk + constraint rel_constraints_rel_segment_fk references rel_segments (segment_id), rel_side char(3) default 'two' not null - constraint rc_rel_side_ck + constraint rel_constraints_rel_side_ck check (rel_side in ('one', 'two')), required_rel_segment integer not null - constraint rc_required_rel_segment + constraint rc_required_rel_segment_fk references rel_segments (segment_id), - constraint rel_constraints_uq + constraint rel_constraints_un unique (rel_segment, rel_side, required_rel_segment) ); @@ -487,9 +487,9 @@ check (rel_side in ('one', 'two')), required_rel_segment integer not null - constraint rc_required_rel_segment + constraint rc_required_rel_segment_fk references rel_segments (segment_id), - constraint rc_segment_required_seg_map_uq + constraint rc_segment_required_seg_map_un unique (rel_segment, rel_side, required_rel_segment) ); Index: openacs-4/packages/acs-kernel/sql/postgresql/security-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/security-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-kernel/sql/postgresql/security-create.sql 18 Jun 2004 18:21:57 -0000 1.6 +++ openacs-4/packages/acs-kernel/sql/postgresql/security-create.sql 25 Sep 2006 17:59:16 -0000 1.7 @@ -26,7 +26,7 @@ last_hit integer constraint sec_session_date_nn not null, - primary key(session_id, module, property_name) + constraint sec_session_prop_pk primary key(session_id, module, property_name) ); create index sec_property_names on sec_session_properties(property_name); Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0b9-5.2.0b10.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0b9-5.2.0b10.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0b9-5.2.0b10.sql 4 Jun 2006 00:45:38 -0000 1.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0b9-5.2.0b10.sql 25 Sep 2006 17:59:17 -0000 1.3 @@ -6,7 +6,7 @@ create table acs_data_links ( rel_id integer not null - constraint acs_data_links_pk primary key, + constraint acs_data_links_rel_id_pk primary key, object_id_one integer not null constraint acs_data_links_one_fk references acs_objects (object_id)