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

--
-- Table structure for table `beam_line_object`
--

CREATE TABLE beam_line_object (
  Object_ID int(11) NOT NULL default '0',
  Name varchar(50) NOT NULL default '',
  Description varchar(255) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Is_Current int(11) NOT NULL default '0',
  PRIMARY KEY  (Object_ID,Is_Current)
) TYPE=InnoDB;

--
-- Table structure for table `beam_line_param`
--

CREATE TABLE beam_line_param (
  Object_ID int(11) NOT NULL default '0',
  Name varchar(50) NOT NULL default '',
  Value varchar(50) NOT NULL default '',
  Units varchar(50) default NULL,
  Description varchar(255) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Is_Current int(11) NOT NULL default '0',
  PRIMARY KEY  (Object_ID,Name,Is_Current)
) TYPE=InnoDB;

--
-- Table structure for table `button`
--

CREATE TABLE button (
  Name varchar(50) default NULL,
  Type varchar(50) default NULL,
  Location int(11) default NULL,
  Is_Current int(11) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Branchline varchar(20) default NULL
) TYPE=InnoDB;

--
-- Table structure for table `cmd`
--

CREATE TABLE cmd (
  CmdID int(11) NOT NULL auto_increment,
  action varchar(50) NOT NULL default '',
  object varchar(50) NOT NULL default '',
  state varchar(50) NOT NULL default '',
  wait varchar(50) NOT NULL default '',
  status varchar(20) default NULL,
  cmdDate timestamp(14) NOT NULL,
  PRIMARY KEY  (CmdID)
) TYPE=InnoDB;

--
-- Table structure for table `corba_ref`
--

CREATE TABLE corba_ref (
  Name varchar(50) default NULL,
  Ref text,
  Create_Date timestamp(14) NOT NULL,
  Is_Current int(11) default NULL,
  App_Name varchar(50) default NULL
) TYPE=InnoDB;

--
-- Table structure for table `debug_log`
--

CREATE TABLE debug_log (
  LogID int(11) NOT NULL auto_increment,
  name varchar(50) default NULL,
  type varchar(30) default NULL,
  msg text,
  Create_Date timestamp(14) NOT NULL,
  PRIMARY KEY  (LogID)
) TYPE=InnoDB;

--
-- Table structure for table `defaultbranchline`
--

CREATE TABLE defaultbranchline (
  Hostname varchar(128) NOT NULL default '',
  Branchline varchar(32) NOT NULL default '',
  PRIMARY KEY  (Hostname)
) TYPE=InnoDB;

--
-- Table structure for table `iplookup`
--

CREATE TABLE iplookup (
  IPAddress char(32) NOT NULL default '',
  IsConsole char(4) default NULL,
  Beamline char(32) default NULL,
  IsDevel char(4) default NULL,
  dcsXsize int(11) default NULL,
  dcsYsize int(11) default NULL,
  dcsXoffset int(11) default NULL,
  dcsYoffset int(11) default NULL,
  PRIMARY KEY  (IPAddress)
) TYPE=InnoDB;

--
-- Table structure for table `object_relationship`
--

CREATE TABLE object_relationship (
  Object_ID int(11) NOT NULL default '0',
  Parent_ID int(11) NOT NULL default '0',
  Is_Current int(11) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Location int(11) default NULL
) TYPE=InnoDB;

--
-- Table structure for table `person`
--

CREATE TABLE person (
  Person_ID int(11) NOT NULL auto_increment,
  FirstName varchar(30) NOT NULL default '',
  LastName varchar(30) NOT NULL default '',
  phone varchar(30) default NULL,
  email varchar(50) default NULL,
  create_date timestamp(14) NOT NULL,
  PRIMARY KEY  (Person_ID)
) TYPE=InnoDB;

--
-- Table structure for table `pm`
--

CREATE TABLE pm (
  Type varchar(50) NOT NULL default '',
  Name varchar(50) NOT NULL default '',
  Status varchar(50) default NULL,
  Person_ID int(11) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Branchline varchar(20) default NULL,
  Protocol_ID int(11) NOT NULL default '0'
) TYPE=InnoDB;

--
-- Table structure for table `priv`
--

CREATE TABLE priv (
  privID int(11) NOT NULL default '0',
  name varchar(30) default NULL,
  create_date timestamp(14) NOT NULL,
  PRIMARY KEY  (privID)
) TYPE=InnoDB;

--
-- Table structure for table `protocol_main`
--

CREATE TABLE protocol_main (
  Type varchar(50) NOT NULL default '',
  Name varchar(50) NOT NULL default '',
  Status varchar(50) NOT NULL default '',
  Person_ID int(11) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Branchline varchar(20) default NULL,
  Protocol_ID int(11) NOT NULL default '0',
  KEY Protmain_id_status (Protocol_ID,Status)
) TYPE=InnoDB;

--
-- Table structure for table `protocol_main_temp`
--

CREATE TABLE protocol_main_temp (
  Type varchar(50) NOT NULL default '',
  Name varchar(50) NOT NULL default '',
  Status varchar(50) default NULL,
  Person_ID int(11) default NULL,
  Create_Date timestamp(14) NOT NULL,
  Branchline varchar(20) default NULL,
  Protocol_ID int(11) NOT NULL default '0'
) TYPE=InnoDB;

--
-- Table structure for table `protocol_param`
--

CREATE TABLE protocol_param (
  Protocol_ID int(11) NOT NULL default '0',
  Step_Number int(11) NOT NULL default '0',
  Param_Name varchar(50) NOT NULL default '',
  Param_Value varchar(50) NOT NULL default '',
  PRIMARY KEY  (Protocol_ID,Step_Number,Param_Name)
) TYPE=InnoDB;

--
-- Table structure for table `protocol_step`
--

CREATE TABLE protocol_step (
  Protocol_ID int(11) NOT NULL default '0',
  Step_Number int(11) NOT NULL default '0',
  Step_Type varchar(50) NOT NULL default '',
  Object varchar(50) NOT NULL default '',
  State varchar(50) NOT NULL default '',
  wait int(11) NOT NULL default '0',
  Timeout int(11) NOT NULL default '0',
  TmtMessage varchar(255) NOT NULL default '',
  PRIMARY KEY  (Protocol_ID,Step_Number)
) TYPE=InnoDB;

--
-- Table structure for table `stagedata`
--

CREATE TABLE stagedata (
  id int(11) NOT NULL default '0',
  num int(11) NOT NULL default '0',
  pos float NOT NULL default '0',
  err float NOT NULL default '0',
  posOrig float NOT NULL default '0',
  x float NOT NULL default '0',
  y float NOT NULL default '0',
  z float NOT NULL default '0',
  angle float NOT NULL default '0',
  det_dist float NOT NULL default '200',
  zoom int(11) NOT NULL default '1',
  PRIMARY KEY  (id,num)
) TYPE=InnoDB;

--
-- Table structure for table `stagemain`
--

CREATE TABLE stagemain (
  id int(11) NOT NULL auto_increment,
  stage varchar(20) default NULL,
  branchline varchar(10) NOT NULL default '',
  type varchar(20) NOT NULL default '',
  numPoint int(11) NOT NULL default '0',
  modifyDate timestamp(14) NOT NULL,
  createDate timestamp(14) NOT NULL default '00000000000000',
  PRIMARY KEY  (id)
) TYPE=InnoDB;

--
-- Table structure for table `step_type`
--

CREATE TABLE step_type (
  Protocol_Type varchar(50) NOT NULL default '',
  Step_Type varchar(50) NOT NULL default '',
  Description varchar(255) default NULL,
  Create_Date timestamp(14) NOT NULL,
  PRIMARY KEY  (Protocol_Type,Step_Type)
) TYPE=InnoDB;

--
-- Table structure for table `texlayout`
--

CREATE TABLE texlayout (
  name varchar(50) default NULL,
  value text,
  version int(11) default NULL
) TYPE=InnoDB;

--
-- Table structure for table `users`
--

CREATE TABLE users (
  username varchar(30) NOT NULL default '',
  privID int(11) default NULL,
  first_name varchar(30) default NULL,
  last_name varchar(30) default NULL,
  phone varchar(30) default NULL,
  email varchar(50) default NULL,
  title varchar(30) default NULL,
  create_date timestamp(14) NOT NULL,
  PRIMARY KEY  (username)
) TYPE=InnoDB;

