
----------------------------------------------------------------
--
-- Table creation scripts for class mrna
--

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


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

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

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

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