 #
 CREATE TABLE repeat_feature (
   id        int(10) unsigned NOT NULL auto_increment,
-  contig    int(10) unsigned NOT NULL,
+  contig    int(10) unsigned NOT NULL,         # foreign key contig:internal_id
   seq_start int(10) NOT NULL,
   seq_end   int(10) NOT NULL,
   score     double(16,4) NOT NULL,
   strand    tinyint(1) DEFAULT '1' NOT NULL,
-  analysis  int(10) unsigned NOT NULL,
+  analysis  int(10) unsigned NOT NULL,         # foregin key analysisprocess:analysisId
   hstart    int(11) NOT NULL,
   hend      int(11) NOT NULL,
   hid       varchar(40) NOT NULL,

#
# Table structure for table 'exon'
#
CREATE TABLE exon (
  exon_id       int unsigned NOT NULL auto_increment,
  contig_id     int(10) unsigned NOT NULL,
  seq_start     int(10) NOT NULL,
  seq_end       int(10) NOT NULL,
  strand        tinyint(2) NOT NULL,

  phase         tinyint(2) NOT NULL,
  end_phase     tinyint(2) NOT NULL,
  sticky_rank   int(10) DEFAULT '1' NOT NULL,
  
  PRIMARY KEY ( exon_id, sticky_rank),
  KEY contig (contig_id)
);

CREATE TABLE exon_stable_id (
    exon_id   int unsigned not null,
    stable_id VARCHAR(40) not null,
    version   int(10) DEFAULT '1' NOT NULL,
    created   datetime NOT NULL,

#
CREATE TABLE feature (
  id            int(10) unsigned NOT NULL auto_increment,
  contig        int(10) unsigned NOT NULL,      # foreign key contig:internal_id  
  seq_start     int(10) NOT NULL,
  seq_end       int(10) NOT NULL,
  score         double(16,4) NOT NULL,
  strand        int(1) DEFAULT '1' NOT NULL,
  analysis      int(10) unsigned NOT NULL,      # foreign key analysisprocess:analysisId
  name          varchar(40),
  hstart        int(11) NOT NULL,
  hend          int(11) NOT NULL,
