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

----------------------------------------------------------------
--
-- Schema
--
use genbank;


----------------------------------------------------------------
--
-- Main table - source
--
CREATE TABLE genbank.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)
	) TYPE=INNODB
;

----------------------------------------------------------------
--
-- Multivalue field - source_db_xref
--
CREATE TABLE genbank.source_db_xref
	(
		id                               	VARCHAR(32)	NOT NULL,
		db_xref                          	VARCHAR(255)
	) TYPE=INNODB
;
CREATE INDEX source_db_xref_id_index ON genbank.source_db_xref (id);

----------------------------------------------------------------
--
-- Multivalue field - source_note
--
CREATE TABLE genbank.source_note
	(
		id                               	VARCHAR(32)	NOT NULL,
		note                             	VARCHAR(255)
	) TYPE=INNODB
;
CREATE INDEX source_note_id_index ON genbank.source_note (id);

----------------------------------------------------------------
--
-- Multivalue field - source_sub_species
--
CREATE TABLE genbank.source_sub_species
	(
		id                               	VARCHAR(32)	NOT NULL,
		sub_species                      	VARCHAR(255)
	) TYPE=INNODB
;
CREATE INDEX source_sub_species_id_index ON genbank.source_sub_species (id);

----------------------------------------------------------------
--
-- Multivalue field - source_transl_except
--
CREATE TABLE genbank.source_transl_except
	(
		id                               	VARCHAR(32)	NOT NULL,
		transl_except                    	VARCHAR(255)
	) TYPE=INNODB
;
CREATE INDEX source_transl_except_id_index ON genbank.source_transl_except (id);
