
----------------------------------------------------------------
--
-- Table creation scripts for class cds
--

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


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

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

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

----------------------------------------------------------------
--
-- Multivalue field - cds_evidence
--
CREATE TABLE genbank.cds_evidence
	(
		id                               	VARCHAR(32)	NOT NULL,
		evidence                         	VARCHAR(255)
	)
;
CREATE INDEX cds_evidence_id_index ON genbank.cds_evidence (id);
GRANT select ON genbank.cds_evidence TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - cds_function
--
CREATE TABLE genbank.cds_function
	(
		id                               	VARCHAR(32)	NOT NULL,
		function                         	VARCHAR(255)
	)
;
CREATE INDEX cds_function_id_index ON genbank.cds_function (id);
GRANT select ON genbank.cds_function TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - cds_locus_tag
--
CREATE TABLE genbank.cds_locus_tag
	(
		id                               	VARCHAR(32)	NOT NULL,
		locus_tag                        	VARCHAR(255)
	)
;
CREATE INDEX cds_locus_tag_id_index ON genbank.cds_locus_tag (id);
GRANT select ON genbank.cds_locus_tag TO amaze;

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

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

----------------------------------------------------------------
--
-- Multivalue field - cds_transl_except
--
CREATE TABLE genbank.cds_transl_except
	(
		id                               	VARCHAR(32)	NOT NULL,
		transl_except                    	VARCHAR(255)
	)
;
CREATE INDEX cds_transl_except_id_index ON genbank.cds_transl_except (id);
GRANT select ON genbank.cds_transl_except TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - cds_transl_table
--
CREATE TABLE genbank.cds_transl_table
	(
		id                               	VARCHAR(32)	NOT NULL,
		transl_table                     	VARCHAR(255)
	)
;
CREATE INDEX cds_transl_table_id_index ON genbank.cds_transl_table (id);
GRANT select ON genbank.cds_transl_table TO amaze;

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