
----------------------------------------------------------------
--
-- Table creation scripts for class source
--

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


----------------------------------------------------------------
--
-- Main table - source
--
CREATE TABLE source
	(
		id                               	VARCHAR(32)	NOT NULL PRIMARY KEY,
		chrom_position                   	VARCHAR(255),
		chromosome                       	VARCHAR(255),
		contig                           	VARCHAR(255),
		isolate                          	VARCHAR(255),
		organism                         	VARCHAR(255),
		plasmid                          	VARCHAR(255),
		serotype                         	VARCHAR(255),
		strain                           	VARCHAR(255),
		sub_strain                       	VARCHAR(255),
		taxid                            	VARCHAR(255),
		type                             	VARCHAR(255)
	)
;
GRANT select ON source TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_clone
--
CREATE TABLE source_clone
	(
		id                               	VARCHAR(32)	NOT NULL,
		clone                            	VARCHAR(255)
	)
;
CREATE INDEX source_clone_id_index ON source_clone (id);
GRANT select ON source_clone TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_db_xref
--
CREATE TABLE source_db_xref
	(
		id                               	VARCHAR(32)	NOT NULL,
		db_xref                          	VARCHAR(255)
	)
;
CREATE INDEX source_db_xref_id_index ON source_db_xref (id);
GRANT select ON source_db_xref TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_mol_type
--
CREATE TABLE source_mol_type
	(
		id                               	VARCHAR(32)	NOT NULL,
		mol_type                         	VARCHAR(255)
	)
;
CREATE INDEX source_mol_type_id_index ON source_mol_type (id);
GRANT select ON source_mol_type TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_note
--
CREATE TABLE source_note
	(
		id                               	VARCHAR(32)	NOT NULL,
		note                             	VARCHAR(255)
	)
;
CREATE INDEX source_note_id_index ON source_note (id);
GRANT select ON source_note TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_organelle
--
CREATE TABLE source_organelle
	(
		id                               	VARCHAR(32)	NOT NULL,
		organelle                        	VARCHAR(255)
	)
;
CREATE INDEX source_organelle_id_index ON source_organelle (id);
GRANT select ON source_organelle TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_tissue_lib
--
CREATE TABLE source_tissue_lib
	(
		id                               	VARCHAR(32)	NOT NULL,
		tissue_lib                       	VARCHAR(255)
	)
;
CREATE INDEX source_tissue_lib_id_index ON source_tissue_lib (id);
GRANT select ON source_tissue_lib TO amaze;

----------------------------------------------------------------
--
-- Multivalue field - source_transl_except
--
CREATE TABLE source_transl_except
	(
		id                               	VARCHAR(32)	NOT NULL,
		transl_except                    	VARCHAR(255)
	)
;
CREATE INDEX source_transl_except_id_index ON source_transl_except (id);
GRANT select ON source_transl_except TO amaze;

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