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

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


----------------------------------------------------------------
--
-- Main table - feature
--
CREATE TABLE embl.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),
		organism                         	VARCHAR(255),
		position                         	VARCHAR(255)
	)
;
GRANT select ON embl.feature TO amaze;

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

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

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

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

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

----------------------------------------------------------------
--
-- Multivalue field - feature_codon_start
--
CREATE TABLE embl.feature_codon_start
	(
		id                               	VARCHAR(32)	NOT NULL,
		codon_start                      	VARCHAR(255)
	)
;
CREATE INDEX feature_codon_start_id_index ON embl.feature_codon_start (id);
GRANT select ON embl.feature_codon_start TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_gene
--
CREATE TABLE embl.feature_gene
	(
		id                               	VARCHAR(32)	NOT NULL,
		gene                             	VARCHAR(255)
	)
;
CREATE INDEX feature_gene_id_index ON embl.feature_gene (id);
GRANT select ON embl.feature_gene TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_protein_id
--
CREATE TABLE embl.feature_protein_id
	(
		id                               	VARCHAR(32)	NOT NULL,
		protein_id                       	VARCHAR(255)
	)
;
CREATE INDEX feature_protein_id_id_index ON embl.feature_protein_id (id);
GRANT select ON embl.feature_protein_id TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_transl_table
--
CREATE TABLE embl.feature_transl_table
	(
		id                               	VARCHAR(32)	NOT NULL,
		transl_table                     	VARCHAR(255)
	)
;
CREATE INDEX feature_transl_table_id_index ON embl.feature_transl_table (id);
GRANT select ON embl.feature_transl_table TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_function
--
CREATE TABLE embl.feature_function
	(
		id                               	VARCHAR(32)	NOT NULL,
		function                         	VARCHAR(255)
	)
;
CREATE INDEX feature_function_id_index ON embl.feature_function (id);
GRANT select ON embl.feature_function TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_isolate
--
CREATE TABLE embl.feature_isolate
	(
		id                               	VARCHAR(32)	NOT NULL,
		isolate                          	VARCHAR(255)
	)
;
CREATE INDEX feature_isolate_id_index ON embl.feature_isolate (id);
GRANT select ON embl.feature_isolate TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_mol_type
--
CREATE TABLE embl.feature_mol_type
	(
		id                               	VARCHAR(32)	NOT NULL,
		mol_type                         	VARCHAR(255)
	)
;
CREATE INDEX feature_mol_type_id_index ON embl.feature_mol_type (id);
GRANT select ON embl.feature_mol_type TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_note
--
CREATE TABLE embl.feature_note
	(
		id                               	VARCHAR(32)	NOT NULL,
		note                             	VARCHAR(255)
	)
;
CREATE INDEX feature_note_id_index ON embl.feature_note (id);
GRANT select ON embl.feature_note TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_product
--
CREATE TABLE embl.feature_product
	(
		id                               	VARCHAR(32)	NOT NULL,
		product                          	VARCHAR(255)
	)
;
CREATE INDEX feature_product_id_index ON embl.feature_product (id);
GRANT select ON embl.feature_product TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_translation
--
CREATE TABLE embl.feature_translation
	(
		id                               	VARCHAR(32)	NOT NULL,
		translation                      	VARCHAR(255)
	)
;
CREATE INDEX feature_translation_id_index ON embl.feature_translation (id);
GRANT select ON embl.feature_translation TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_strain
--
CREATE TABLE embl.feature_strain
	(
		id                               	VARCHAR(32)	NOT NULL,
		strain                           	VARCHAR(255)
	)
;
CREATE INDEX feature_strain_id_index ON embl.feature_strain (id);
GRANT select ON embl.feature_strain TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_locus_tag
--
CREATE TABLE embl.feature_locus_tag
	(
		id                               	VARCHAR(32)	NOT NULL,
		locus_tag                        	VARCHAR(255)
	)
;
CREATE INDEX feature_locus_tag_id_index ON embl.feature_locus_tag (id);
GRANT select ON embl.feature_locus_tag TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_sub_strain
--
CREATE TABLE embl.feature_sub_strain
	(
		id                               	VARCHAR(32)	NOT NULL,
		sub_strain                       	VARCHAR(255)
	)
;
CREATE INDEX feature_sub_strain_id_index ON embl.feature_sub_strain (id);
GRANT select ON embl.feature_sub_strain TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - feature_bound_moiety
--
CREATE TABLE embl.feature_bound_moiety
	(
		id                               	VARCHAR(32)	NOT NULL,
		bound_moiety                     	VARCHAR(255)
	)
;
CREATE INDEX feature_bound_moiety_id_index ON embl.feature_bound_moiety (id);
GRANT select ON embl.feature_bound_moiety TO amaze;

----------------------------------------------------------------
--
-- Expanded attribute - feature_db_xref_exp
--
CREATE TABLE embl.feature_db_xref_exp
	(
		id                               	VARCHAR(32)	NOT NULL,
		xref_db                          	VARCHAR(255)
	)
;
CREATE INDEX feature_db_xref_exp_id_index ON embl.feature_db_xref_exp (id);
GRANT select ON embl.feature_db_xref_exp TO amaze;

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