diff --git a/extension/toar_controlled_vocabulary-0.1/Makefile b/extension/toar_controlled_vocabulary-0.1/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..b3758afefb49c1d187a93955e86beedeca6157e1 --- /dev/null +++ b/extension/toar_controlled_vocabulary-0.1/Makefile @@ -0,0 +1,6 @@ +EXTENSION = toar_controlled_vocabulary +DATA = toar_controlled_vocabulary--0.1.sql + +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) diff --git a/extension/toar_controlled_vocabulary-0.1/toar_controlled_vocabulary--0.1.sql b/extension/toar_controlled_vocabulary-0.1/toar_controlled_vocabulary--0.1.sql new file mode 100644 index 0000000000000000000000000000000000000000..ca9eefbea1dfe2a0d68e61b00bc8843f28c0a9e7 --- /dev/null +++ b/extension/toar_controlled_vocabulary-0.1/toar_controlled_vocabulary--0.1.sql @@ -0,0 +1,38 @@ +-- +-- contrib/toar_controlled_vocabulary.sql +-- +-- [Step to install] +-- +-- 1. +-- + +-- INSTALL VERSION: '0.1' + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION toar_controlled_vocabulary" to load this file. \quit + +CREATE TABLE IF NOT EXISTS RC_vocabulary ( + enum_val INT NOT NULL, + enum_str character varying(128) NOT NULL, + PRIMARY KEY(enum_val, enum_str) +); + +INSERT INTO RC_vocabulary (enum_val, enum_str) VALUES + (0, 'PointOfContact'), + (1, 'PrincipalInvestigator'), + (2, 'Originator'), + (3, 'Contributor'), + (4, 'Collaborator'), + (5, 'ResourceProvider'); + +CREATE TABLE IF NOT EXISTS RS_vocabulary ( + enum_val INT NOT NULL, + enum_str character varying(128) NOT NULL, + PRIMARY KEY(enum_val, enum_str) +); + +INSERT INTO RS_vocabulary (enum_val, enum_str) VALUES + (0, 'active'), + (1, 'inactive'), + (2, 'unknown'); + diff --git a/extension/toar_controlled_vocabulary-0.1/toar_controlled_vocabulary.control b/extension/toar_controlled_vocabulary-0.1/toar_controlled_vocabulary.control new file mode 100644 index 0000000000000000000000000000000000000000..7c67f0f12ea61a24d18ac88f05a6055e464ff141 --- /dev/null +++ b/extension/toar_controlled_vocabulary-0.1/toar_controlled_vocabulary.control @@ -0,0 +1,5 @@ +# toar_controlled_vocabulary extension +comment = 'TOAR controlled vocabulary' +default_version = '0.1' +module_pathname = '$libdir/toar_controlled_vocabulary-0.1' +relocatable = false