-- from CMap v1.01 for
-- for construction of links to CMap by report.cgi
-- map_name corresponds to map.name

create table cmap_map (
  map_id varchar(64) NOT NULL,
  map_acc varchar(64) NOT NULL default '',
  map_set_id int(11) NOT NULL default '0',
  map_name varchar(64) NOT NULL default '',
  display_order int(11) NOT NULL default '1',
  map_start double(11,2) default NULL,
  map_stop double(11,2) default NULL,
  PRIMARY KEY  (map_id),
  UNIQUE KEY map_id (map_id,map_set_id,map_name,map_acc),
  UNIQUE KEY map_acc (map_acc),
  KEY `map_set_id` (`map_set_id`)
) ENGINE=InnoDB;

-- DDH 2005-11-01
-- this the meta table

create table tableinfo (
        tablename varchar(100),
        columnname varchar(100),
        realname varchar(100),
        acetagname varchar(100),
        description varchar(255),
        notes text
) ENGINE=InnoDB;
create index tablename_index on tableinfo (tablename);
create index columnname_index on tableinfo (columnname);
create index realname_index on tableinfo (realname);
create index acetagname_index on tableinfo (acetagname);


-- david hummel 2006-03-12
-- use this table to implement non-child tags in text records for the ggupdate scripts
-- i.e. a tag called "publishes_as" for class colleague (fkey is author.fullname_colleagueid)
-- i.e. a tag called "qtl" for class trait (fkey is qtl.traitaffected_traitid)
-- i.e. a tag called "affected_by" for class trait (fkey is geneclasstraitaffected.traitid)

create table extratags (
  -- the class for which we are creating the extra tag
  class varchar(50) NOT NULL,
  -- the name of the tag used in the text record
  tag varchar(50) NOT NULL,
  -- the class that the tag's values will belong to
  -- (add constraint to check for real class)
  isa varchar(50) NOT NULL,
  -- the table that the tag's values will be inserted into
  tbl varchar(50) NOT NULL,
  -- the column in tbl that the tag's values will be inserted into
  col varchar(50) NOT NULL,
  -- the fkey column in tbl that references the class
  -- (add constraint to check for real fkey column)
  fkey varchar(50) NOT NULL
) ENGINE=InnoDB;
create unique index extratags_index on extratags (class,tag,isa,tbl,col,fkey);
create index class_index on extratags (class);
