Commit f9590007 authored by Frank Bergmann's avatar Frank Bergmann

- OpenACS 5.9

parent 29eecf0f
......@@ -7,15 +7,17 @@
<initial-install-p>t</initial-install-p>
<singleton-p>t</singleton-p>
<version name="5.7.0" url="http://www.mayuli.com/acs-repository/download/apm/ref-language-5.7.0.apm">
<version name="5.10.0d1" url="http://www.mayuli.com/acs-repository/download/apm/ref-language-5.10.0d1.apm">
<owner url="mailto:jon@jongriffin.com">Jon Griffin</owner>
<summary>ISO 639-1 language reference data for acs-reference.</summary>
<release-date>2013-09-08</release-date>
<maturity>2</maturity>
<summary>ISO 639-1 language reference data for acs-reference.</summary>
<vendor url="http://www.mayuli.com">Mayuli Enterprises, LLC</vendor>
<description format="text/plain">This is the ISO 639-1 language reference data (with languages names in English).</description>
<provides url="ref-language" version="5.7.0"/>
<requires url="acs-kernel" version="5.7.0"/>
<requires url="acs-reference" version="5.7.0"/>
<provides url="ref-language" version="5.10.0d1"/>
<requires url="acs-kernel" version="5.10.0d1"/>
<requires url="acs-reference" version="5.10.0d1"/>
<callbacks>
<callback type="after-install" proc="ref_language::apm::after_install"/>
......
......@@ -7,34 +7,14 @@
-- ISO 639
-- fraber 110322: language_codes already existed in ]po[ V3.4,
-- so we have to put a "v_count" around this creation here.
create or replace function inline_0 ()
returns integer as '
declare
v_count integer;
begin
select count(*) into v_count from user_tab_columns
where lower(table_name) = ''language_codes'';
IF v_count > 0 THEN return 1; END IF;
create table language_codes (
language_id char(2)
constraint language_codes_language_id_pk
primary key,
name varchar(100)
constraint language_codes_name_nn
not null
);
RETURN 0;
end;' language 'plpgsql';
select inline_0 ();
drop function inline_0 ();
create table language_codes (
language_id char(2)
constraint language_codes_language_id_pk
primary key,
name varchar(100)
constraint language_codes_name_nn
not null
);
comment on table language_codes is '
This is data from the ISO 639-1 standard on language codes.
......@@ -48,11 +28,6 @@ comment on column language_codes.name is '
This is the English version of the language name.
';
-- Make sure the reference did not exist before
delete from acs_reference_repositories where table_name = 'LANGUAGE_CODES';
-- now register this table with the repository
select acs_reference__new(
'LANGUAGE_CODES',
......
......@@ -12,16 +12,21 @@
drop table language_639_2_codes;
create function inline_0() returns integer as '
declare
--
-- procedure inline_0/0
--
CREATE OR REPLACE FUNCTION inline_0(
) RETURNS integer AS $$
DECLARE
rec acs_reference_repositories%ROWTYPE;
begin
for rec in select * from acs_reference_repositories where upper(table_name) = ''LANGUAGE_CODES'' loop
execute ''drop table '' || rec.table_name;
BEGIN
for rec in select * from acs_reference_repositories where upper(table_name) = 'LANGUAGE_CODES' loop
execute 'drop table ' || rec.table_name;
perform acs_reference__delete(rec.repository_id);
end loop;
return 0;
end;' language 'plpgsql';
END;
$$ LANGUAGE plpgsql;
select inline_0();
drop function inline_0();
......
......@@ -27,7 +27,10 @@ ad_proc -private ref_language::apm::after_upgrade {
5.6.0d1 5.6.0d2 {
# If the constraint doesn't exist, we don't care ...
catch [db_dml drop_constraint {}]
catch {
db_dml drop_unique_index {}
db_dml drop_constraint {}
}
set new_languages [ref_language::apm::lang_list_for_5_6_0d2]
......
......@@ -8,4 +8,10 @@
</querytext>
</fullquery>
<fullquery name="ref_language::apm::after_upgrade.drop_unique_index">
<querytext>
drop index language_codes_name_uq
</querytext>
</fullquery>
</queryset>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment