
----------------------------------------------------------------
--
-- Table creation scripts for class contig
--

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


----------------------------------------------------------------
--
-- Main table - contig
--
CREATE TABLE contig
	(
		id                               	VARCHAR(32)	NOT NULL PRIMARY KEY,
		date                             	VARCHAR(255),
		file                             	VARCHAR(255),
		form                             	VARCHAR(255),
		genbank_file                     	VARCHAR(255),
		keywords                         	VARCHAR(255),
		length                           	VARCHAR(255),
		organism                         	VARCHAR(255),
		reference                        	VARCHAR(255),
		seq_dir                          	VARCHAR(255),
		taxid                            	VARCHAR(255),
		taxo_group                       	VARCHAR(255),
		type                             	VARCHAR(255)
	)
;
GRANT select ON contig TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - contig_accession
--
CREATE TABLE contig_accession
	(
		id                               	VARCHAR(32)	NOT NULL,
		accession                        	VARCHAR(255)
	)
;
CREATE INDEX contig_accession_id_index ON contig_accession (id);
GRANT select ON contig_accession TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - contig_comment
--
CREATE TABLE contig_comment
	(
		id                               	VARCHAR(32)	NOT NULL,
		comment                          	VARCHAR(255)
	)
;
CREATE INDEX contig_comment_id_index ON contig_comment (id);
GRANT select ON contig_comment TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - contig_definition
--
CREATE TABLE contig_definition
	(
		id                               	VARCHAR(32)	NOT NULL,
		definition                       	VARCHAR(255)
	)
;
CREATE INDEX contig_definition_id_index ON contig_definition (id);
GRANT select ON contig_definition TO amaze;

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

----------------------------------------------------------------
--
-- Multivalue field - contig_version
--
CREATE TABLE contig_version
	(
		id                               	VARCHAR(32)	NOT NULL,
		version                          	VARCHAR(255)
	)
;
CREATE INDEX contig_version_id_index ON contig_version (id);
GRANT select ON contig_version TO amaze;

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

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