Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ref-itu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
ref-itu
Commits
93d30019
Commit
93d30019
authored
Apr 29, 2007
by
Malte Sussdorff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial Import
parents
Pipeline
#580
failed with stages
Changes
6
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
211 additions
and
0 deletions
+211
-0
ref-itu.info
ref-itu.info
+37
-0
ref-itu-data.sql
sql/common/ref-itu-data.sql
+0
-0
ref-itu-create.sql
sql/oracle/ref-itu-create.sql
+57
-0
ref-itu-drop.sql
sql/oracle/ref-itu-drop.sql
+36
-0
ref-itu-create.sql
sql/postgresql/ref-itu-create.sql
+53
-0
ref-itu-drop.sql
sql/postgresql/ref-itu-drop.sql
+28
-0
No files found.
ref-itu.info
0 → 100644
View file @
93d30019
<?xml version="1.0"?>
<!-- Generated by the OpenACS Package Manager -->
<package
key=
"ref-itu"
url=
"http://openacs.org/repository/apm/packages/ref-itu"
type=
"apm_service"
>
<package-name>
Reference Data - ITU Code
</package-name>
<pretty-plural>
Reference Data - ITU Codes
</pretty-plural>
<initial-install-p>
f
</initial-install-p>
<singleton-p>
f
</singleton-p>
<version
name=
"0.1d"
url=
"http://openacs.org/repository/download/apm/ref-itu-0.1d.apm"
>
<database-support>
<database>
oracle
</database>
<database>
postgresql
</database>
</database-support>
<owner
url=
"mailto:jon@jongriffin.com"
>
Jon Griffin
</owner>
<summary>
Telecom Country codes, ITU-T Recommendation E.164 for acs-reference.
</summary>
<vendor
url=
"http://www.mayuli.com"
>
Mayuli Enterprises, LLC
</vendor>
<description
format=
"text/html"
>
List of ITU-T Recommendation E.164 assigned country codes.
</description>
<provides
url=
"ref-itu"
version=
"0.1d"
/>
<requires
url=
"acs-kernel"
version=
"4.6"
/>
<requires
url=
"acs-reference"
version=
"0.2d"
/>
<files>
<file
type=
"package_spec"
path=
"ref-itu.info"
/>
<file
type=
"data_model"
db_type=
"oracle"
path=
"sql/common/ref-itu-data.sql"
/>
<file
type=
"data_model_create"
db_type=
"oracle"
path=
"sql/oracle/ref-itu-create.sql"
/>
<file
type=
"data_model_drop"
db_type=
"oracle"
path=
"sql/oracle/ref-itu-drop.sql"
/>
<file
type=
"data_model_create"
db_type=
"postgresql"
path=
"sql/postgresql/ref-itu-create.sql"
/>
<file
type=
"data_model_drop"
db_type=
"postgresql"
path=
"sql/postgresql/ref-itu-drop.sql"
/>
</files>
<parameters>
<!-- No version parameters -->
</parameters>
</version>
</package>
sql/common/ref-itu-data.sql
0 → 100644
View file @
93d30019
This diff is collapsed.
Click to expand it.
sql/oracle/ref-itu-create.sql
0 → 100644
View file @
93d30019
-- packages/ref-itu/sql/postgresql/ref-itu-create.sql
--
-- @author jon@jongriffin.com.com
-- @creation-date 2003-02-25
-- @cvs-id $Id$
create
table
itu_notes
(
note_id
char
(
3
)
constraint
itu_notes_id_pk
primary
key
,
note
varchar
(
1024
)
constraint
itu_notes_note_nn
not
null
constraint
itu_notes_note_uq
unique
);
create
table
itu_codes
(
itu_id
integer
constraint
itu_code_pk
primary
key
,
code
char
(
6
)
constraint
itu_code_nn
not
null
,
country
varchar
(
100
)
constraint
itu_country_nn
not
null
,
note_id
char
(
3
)
constraint
itu_codes_note_fk
references
itu_notes
(
note_id
)
);
comment
on
table
itu_codes
is
'
This is the ITU country dialing code list.
'
;
-- add this table into the reference repository
declare
v_id
integer
;
begin
v_id
:
=
acs_reference
.
new
(
table_name
=>
'itu_codes'
,
last_update
=>
to_date
(
'2002-05-01'
,
'YYYY-MM-DD'
),
source
=>
'ITU'
,
source_url
=>
'http://www.itu.int/'
,
effective_date
=>
'2002-05-01'
);
commit
;
end
;
/
-- This is the translated mapping of country names
-- Need to see if ITU used the same country names as ISO and if so, we can use those for
-- translated names, but they have some non-country names
@
'../common/ref-itu-data.sql'
sql/oracle/ref-itu-drop.sql
0 → 100644
View file @
93d30019
-- Drop the ACS Reference ITU data
--
-- @author jon@jongriffin.com
-- @cvs-id $Id$
set
serveroutput
on
-- drop all associated tables and packages
-- I am not sure this is a good idea since we have no way to register
-- if any other packages are using this data.
-- This will probably fail if their is a child table using this.
-- I can probably make this cleaner also, but ... no time today
declare
cursor
refsrc_cur
is
select
table_name
,
package_name
,
repository_id
from
acs_reference_repositories
where
upper
(
table_name
)
like
'ITU_CODE%'
order
by
repository_id
desc
;
begin
for
rec
in
refsrc_cur
loop
dbms_output
.
put_line
(
'Dropping '
||
rec
.
table_name
);
execute
immediate
'drop table '
||
rec
.
table_name
;
if
rec
.
package_name
is
not
null
then
execute
immediate
'drop package '
||
rec
.
package_name
;
end
if
;
acs_reference
.
del
(
rec
.
repository_id
);
end
loop
;
end
;
/
show
errors
-- drop the notes
drop
table
itu_notes
;
sql/postgresql/ref-itu-create.sql
0 → 100644
View file @
93d30019
-- packages/ref-itu/sql/postgresql/ref-itu-create.sql
--
-- @author jon@jongriffin.com.com
-- @creation-date 2003-02-25
-- @cvs-id $Id$
create
table
itu_notes
(
note_id
char
(
3
)
constraint
itu_notes_id_pk
primary
key
,
note
text
constraint
itu_notes_note_nn
not
null
constraint
itu_notes_note_uq
unique
);
create
table
itu_codes
(
itu_id
integer
constraint
itu_code_pk
primary
key
,
code
char
(
6
)
constraint
itu_code_nn
not
null
,
country
varchar
(
100
)
constraint
itu_country_nn
not
null
,
note_id
char
(
3
)
constraint
itu_codes_note_fk
references
itu_notes
(
note_id
)
);
comment
on
table
itu_codes
is
'
This is the ITU country dialing code list.
'
;
-- add this table into the reference repository
select
acs_reference__new
(
'itu_codes'
,
-- table_name
'2002-05-01'
,
'ITU'
,
-- source
'http://www.itu.int/'
,
-- source_url
to_date
(
'2002-05-01'
,
'YYYY-MM-DD'
)
-- effective_date
);
-- This is the translated mapping of country names
-- Need to see if ITU used the same country names as ISO and if so, we can use those for
-- translated names, but they have some non-country names
begin
;
\
i
..
/
common
/
ref
-
itu
-
data
.
sql
end
;
sql/postgresql/ref-itu-drop.sql
0 → 100644
View file @
93d30019
-- Drop the ACS Reference ITU data
--
-- @author jon@jongriffin.com
-- @cvs-id $Id$
-- drop all associated tables and packages
-- I am not sure this is a good idea since we have no way to register
-- if any other packages are using this data.
-- This will probably fail if their is a child table using this.
-- I can probably make this cleaner also, but ... no time today
create
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) like
''
ITU_CODE%
''
loop
execute
''
drop table
''
|| rec.table_name;
perform acs_reference__delete(rec.repository_id);
end loop;
return 0;
end;'
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
-- drop the notes
drop
table
itu_notes
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment