
----------------------------------------------------------------
--
-- Table creation scripts for class feature
--

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


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

----------------------------------------------------------------
--
-- Multivalue field - feature_gene_id
--
CREATE TABLE genbank.feature_gene_id
	(
		id                               	VARCHAR(32)	NOT NULL,
		gene_id                          	VARCHAR(255)
	)
;
CREATE INDEX feature_gene_id_id_index ON genbank.feature_gene_id (id);
GRANT select ON genbank.feature_gene_id TO amaze;

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

----------------------------------------------------------------
--
-- Multivalue field - feature_db_xref
--
CREATE TABLE genbank.feature_db_xref
	(
		id                               	VARCHAR(32)	NOT NULL,
		db_xref                          	VARCHAR(255)
	)
;
CREATE INDEX feature_db_xref_id_index ON genbank.feature_db_xref (id);
GRANT select ON genbank.feature_db_xref TO amaze;

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

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

----------------------------------------------------------------
--
-- Multivalue field - feature_ec_number
--
CREATE TABLE genbank.feature_ec_number
	(
		id                               	VARCHAR(32)	NOT NULL,
		ec_number                        	VARCHAR(255)
	)
;
CREATE INDEX feature_ec_number_id_index ON genbank.feature_ec_number (id);
GRANT select ON genbank.feature_ec_number TO amaze;

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