
----------------------------------------------------------------
--
-- Table creation scripts for class trna
--

----------------------------------------------------------------
--
-- Schema
--
alter session set current_schema=embl;


----------------------------------------------------------------
--
-- Main table - trna
--
CREATE TABLE trna
	(
		id                               	VARCHAR(32)	NOT NULL PRIMARY KEY,
		geneid                           	VARCHAR(255),
		contig                           	VARCHAR(255),
		description                      	VARCHAR(255),
		end_pos                          	VARCHAR(255),
		name                             	VARCHAR(255),
		organism                         	VARCHAR(255),
		position                         	VARCHAR(255),
		source                           	VARCHAR(255),
		start_pos                        	VARCHAR(255),
		strand                           	VARCHAR(255),
		type                             	VARCHAR(255)
	)
;
GRANT select ON trna TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - trna_method
--
CREATE TABLE trna_method
	(
		id                               	VARCHAR(32)	NOT NULL,
		method                           	VARCHAR(255)
	)
;
CREATE INDEX trna_method_id_index ON trna_method (id);
GRANT select ON trna_method TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - trna_names
--
CREATE TABLE trna_names
	(
		id                               	VARCHAR(32)	NOT NULL,
		names                            	VARCHAR(255),
		qualifier                        	VARCHAR(20)
	)
;
CREATE INDEX trna_names_id_index ON trna_names (id);
GRANT select ON trna_names TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - trna_product
--
CREATE TABLE trna_product
	(
		id                               	VARCHAR(32)	NOT NULL,
		product                          	VARCHAR(255)
	)
;
CREATE INDEX trna_product_id_index ON trna_product (id);
GRANT select ON trna_product TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - trna_systematic_id
--
CREATE TABLE trna_systematic_id
	(
		id                               	VARCHAR(32)	NOT NULL,
		systematic_id                    	VARCHAR(255)
	)
;
CREATE INDEX trna_systematic_id_id_index ON trna_systematic_id (id);
GRANT select ON trna_systematic_id TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - trna_temporary_systematic_id
--
CREATE TABLE trna_temporary_systematic_id
	(
		id                               	VARCHAR(32)	NOT NULL,
		temporary_systematic_id          	VARCHAR(255)
	)
;
CREATE INDEX trna_temporary_systematic_id_id_index ON trna_temporary_systematic_id (id);
GRANT select ON trna_temporary_systematic_id TO amaze;

----------------------------------------------------------------
--
-- Expanded attribute - trna_xrefs
--
CREATE TABLE trna_xrefs
	(
		id                               	VARCHAR(32)	NOT NULL,
		external_db                      	VARCHAR(255),
		external_id                      	VARCHAR(255)
	)
;
CREATE INDEX trna_xrefs_id_index ON trna_xrefs (id);
GRANT select ON trna_xrefs TO amaze;

----------------------------------------------------------------
--
-- Quit
--
quit;