-- MySQL dump 9.10
--
-- Host: localhost    Database: eval
-- ------------------------------------------------------
-- Server version	4.0.18-max-nt

--
-- Table structure for table `connection`
--

CREATE TABLE connection (
  connectionID int(11) NOT NULL auto_increment,
  modifyDate timestamp(14) NOT NULL,
  createDate timestamp(14) NOT NULL default '00000000000000',
  sessionID int(11) default NULL,
  logger_url varchar(120) default NULL,
  PRIMARY KEY  (connectionID)
) TYPE=InnoDB;

--
-- Table structure for table `dcsstatus`
--

CREATE TABLE dcsstatus (
  branchline varchar(50) NOT NULL default '',
  status enum('START','STOP') NOT NULL default 'START'
) TYPE=InnoDB;

--
-- Table structure for table `localcache`
--

CREATE TABLE localcache (
  snapID int(11) NOT NULL default '0',
  runID int(11) NOT NULL default '0',
  local_host varchar(50) default NULL,
  local_dir varchar(200) default NULL,
  filename varchar(50) default NULL,
  PRIMARY KEY  (snapID,runID)
) TYPE=InnoDB;

--
-- Table structure for table `locks`
--

CREATE TABLE locks (
  lockID int(11) NOT NULL auto_increment,
  modifyDate timestamp(14) NOT NULL,
  runID int(11) default NULL,
  tag varchar(80) default NULL,
  status varchar(20) default NULL,
  evalID int(11) default NULL,
  gmtime decimal(10,0) NOT NULL default '0',
  PRIMARY KEY  (lockID)
) TYPE=InnoDB;

--
-- Table structure for table `runarchive`
--

CREATE TABLE runarchive (
  runID int(11) NOT NULL auto_increment,
  runType varchar(30) default NULL,
  beamID int(11) default NULL,
  branchline varchar(20) NOT NULL default '',
  protocolID int(11) default NULL,
  runName varchar(50) default NULL,
  xtalID int(11) NOT NULL default '-1',
  deltaPhi double(15,6) default NULL,
  skipPhi double(16,4) default '0.0000',
  deltaWedge double(15,6) default '0.000000',
  time double(15,6) default NULL,
  startPhi double(15,6) default '0.000000',
  stopPhi double(15,6) default NULL,
  wedgeSize double(15,6) default NULL,
  filePath varchar(255) default NULL,
  fileTemplate varchar(255) default NULL,
  distance double(15,6) default NULL,
  twoTheta double(16,4) default '0.0000',
  wavelength1 double(15,6) default '1.000000',
  wavelength2 double(16,4) default NULL,
  wavelength3 double(16,4) default NULL,
  wavelength4 double(16,4) default NULL,
  wavelength5 double(16,4) default NULL,
  inverseBeam int(5) default '0',
  status varchar(20) default NULL,
  createDate timestamp(14) NOT NULL,
  startFrame int(11) default NULL,
  endFrame int(11) default NULL,
  nextFrame int(11) default NULL,
  detectorMode int(11) default '4',
  runNumber int(11) default NULL,
  sync smallint(6) default '0',
  saveDate timestamp(14) NOT NULL default '00000000000000',
  PRIMARY KEY  (runID),
  KEY Run_runID_branchline (runID,branchline),
  KEY run_xtalid (xtalID)
) TYPE=InnoDB;

--
-- Table structure for table `runinterest`
--

CREATE TABLE runinterest (
  sessionID int(11) NOT NULL default '0',
  runID int(11) NOT NULL default '0',
  PRIMARY KEY  (sessionID,runID)
) TYPE=InnoDB;

--
-- Table structure for table `samplequeue`
--

CREATE TABLE samplequeue (
  crystalID int(11) NOT NULL default '0',
  sessionID int(11) NOT NULL default '0',
  next_flag enum('yes','no') NOT NULL default 'no',
  location varchar(5) default NULL,
  target_flag enum('yes','no') NOT NULL default 'no',
  qorder int(11) NOT NULL default '0',
  PRIMARY KEY  (crystalID,sessionID),
  KEY o_cal (qorder,crystalID,sessionID)
) TYPE=InnoDB;

--
-- Table structure for table `session`
--

CREATE TABLE session (
  sessionID int(11) NOT NULL auto_increment,
  modifyDate timestamp(14) NOT NULL,
  createDate timestamp(14) NOT NULL default '00000000000000',
  status enum('user','auto','inactive') NOT NULL default 'user',
  branchline varchar(12) NOT NULL default '',
  organization varchar(30) NOT NULL default '',
  s_oscillation float(10,2) default NULL,
  s_exposure float(10,2) default NULL,
  s_distance float(10,2) default NULL,
  s_wavelength float(10,2) default NULL,
  s_file varchar(120) default NULL,
  s_wedge float(10,2) default NULL,
  PRIMARY KEY  (sessionID),
  KEY stat (status,branchline),
  KEY bo (branchline,organization)
) TYPE=InnoDB;

--
-- Table structure for table `snaparchive`
--

CREATE TABLE snaparchive (
  snapID int(11) NOT NULL auto_increment,
  runID int(11) NOT NULL default '0',
  sequenceNumber smallint(6) NOT NULL default '0',
  startPhi double(15,6) default NULL,
  deltaPhi double(15,6) default NULL,
  time double(15,6) default NULL,
  beamCurrent double(15,6) default NULL,
  filePath varchar(255) default NULL,
  fileName varchar(255) NOT NULL default '',
  detDist double(15,6) default NULL,
  wavelength double(15,6) default NULL,
  createDate timestamp(14) NOT NULL,
  PRIMARY KEY  (snapID),
  KEY SNAP_RUNID (runID),
  KEY snap_filename (fileName),
  KEY snap_seq (sequenceNumber)
) TYPE=InnoDB;

--
-- Table structure for table `spot`
--

CREATE TABLE spot (
  runID int(11) NOT NULL default '0',
  seq int(11) NOT NULL default '0',
  snapID int(10) unsigned NOT NULL default '0',
  protocol char(12) NOT NULL default 'tnear',
  total int(11) default NULL,
  unimodal int(11) default NULL,
  in_res int(11) default NULL,
  non_ice int(11) default NULL,
  inlier int(11) default NULL,
  proximal int(11) default NULL,
  resolution float(10,2) default NULL,
  maxcell float(10,2) default NULL,
  ice_impact int(11) default NULL,
  intensity_m float(10,2) default NULL,
  intensity_s float(10,2) default NULL,
  area_m float(10,2) default NULL,
  area_s float(10,2) default NULL,
  shape_m float(10,2) default NULL,
  shape_s float(10,2) default NULL,
  eccen_m float(10,2) default NULL,
  eccen_s float(10,2) default NULL,
  neighbor_m float(10,2) default NULL,
  neighbor_s float(10,2) default NULL,
  PRIMARY KEY  (runID,seq,protocol)
) TYPE=InnoDB;

--
-- Table structure for table `xtaleval`
--

CREATE TABLE xtaleval (
  evalID int(11) NOT NULL auto_increment,
  evalType varchar(30) default NULL,
  successCode varchar(200) default NULL,
  xtalID int(11) NOT NULL default '0',
  runID int(11) default NULL,
  snapID int(11) default NULL,
  createDate timestamp(14) NOT NULL,
  indexSolution int(11) default NULL,
  scaleSolution int(11) default NULL,
  qualityscore float(10,2) default NULL,
  resolution double(15,6) default NULL,
  distance double(15,6) default NULL,
  mosaicity double(15,6) default NULL,
  beamCenterX double(15,6) default NULL,
  beamCenterY double(15,6) default NULL,
  rmsResidual double(15,6) default NULL,
  resolutionLimit double(15,6) default NULL,
  resolutionProfile text,
  orientationMatrix text,
  spacegroup varchar(20) default NULL,
  unitCell varchar(80) default NULL,
  findSpotThresh int(11) default NULL,
  findSpotBgMin double(15,6) default NULL,
  findSpotBgMax double(15,6) default NULL,
  cutoffMessage varchar(120) default NULL,
  PRIMARY KEY  (evalID)
) TYPE=InnoDB;

