Skip to content
Snippets Groups Projects
toar_controlled_vocabulary--0.2--0.2.5.sql 781 B
--
-- toardb/extension/toar_controlled_vocabulary/toar_controlled_vocabulary--0.2.5.sql
--
-- [Step to install]
--
-- 1. 
--

-- INSTALL VERSION: '0.2.5'

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION toar_controlled_vocabulary" to load this file. \quit

-- Annotation
-- ==========

-- Kind of Annotation

CREATE TABLE IF NOT EXISTS AK_vocabulary (
   enum_val         INT NOT NULL,
   enum_str         character varying(128) NOT NULL,
   enum_display_str character varying(128) NOT NULL,
   PRIMARY KEY(enum_val, enum_str),
   CONSTRAINT ak_enum_val_unique UNIQUE (enum_val)
;

INSERT INTO AK_vocabulary (enum_val, enum_str, enum_display_str) VALUES
   (0, 'User', 'user comment'),
   (1, 'Provider', 'provider comment');