
----------------------------------------------------------------
--
-- Table creation scripts for class gene
--

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


----------------------------------------------------------------
--
-- Main table - gene
--
CREATE TABLE genbank.gene
	(
		id                               	VARCHAR(32)	NOT NULL PRIMARY KEY,
		chrom_position                   	VARCHAR(255),
		chromosome                       	VARCHAR(255),
		contig                           	VARCHAR(255),
		end_pos                          	VARCHAR(255),
		gene                             	VARCHAR(255),
		organism                         	VARCHAR(255),
		start_pos                        	VARCHAR(255),
		strand                           	VARCHAR(255),
		taxid                            	VARCHAR(255),
		type                             	VARCHAR(255)
	)
;
GRANT select ON genbank.gene TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - gene_exons
--
CREATE TABLE genbank.gene_exons
	(
		id                               	VARCHAR(32)	NOT NULL,
		exons                            	VARCHAR(255)
	)
;
CREATE INDEX gene_exons_id_index ON genbank.gene_exons (id);
GRANT select ON genbank.gene_exons TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - gene_introns
--
CREATE TABLE genbank.gene_introns
	(
		id                               	VARCHAR(32)	NOT NULL,
		introns                          	VARCHAR(255)
	)
;
CREATE INDEX gene_introns_id_index ON genbank.gene_introns (id);
GRANT select ON genbank.gene_introns TO amaze;

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

----------------------------------------------------------------
--
-- Multivalue field - gene_note
--
CREATE TABLE genbank.gene_note
	(
		id                               	VARCHAR(32)	NOT NULL,
		note                             	VARCHAR(255)
	)
;
CREATE INDEX gene_note_id_index ON genbank.gene_note (id);
GRANT select ON genbank.gene_note TO amaze;

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