Table schema

FastOffline table schema follows - table are rarely created this way.

After each year, tables are copied to their equivalent post-fixed with _Y# where # stand for the year number. After a copy/backup, the in-place table can be re-initialized as follow:

TRUNCATE  `DAQInfo`;
TRUNCATE `FODetectorTypes`;
TRUNCATE `FOFileType`;
TRUNCATE `FOLocations`;
TRUNCATE `FOMessages`;
TRUNCATE `FOruns`;
TRUNCATE `FOTriggerBits`;
TRUNCATE `FOTriggerSetup`;

This sequence may be used for initialization of a new year after testing.

If you need to re-create the tables from scratch, below is the full SQL set of commands to do so:

-- 
-- Table structure for table `DAQInfo`
-- 

CREATE TABLE `DAQInfo` (
  `file` char(255) NOT NULL default '',
  `runNumber` int(10) NOT NULL default '0',
  `NumEvt` int(10) default NULL,
  `BeginEvt` int(10) default NULL,
  `EndEvt` int(10) default NULL,
  `Current` float(16,8) default NULL,
  `scaleFactor` float(16,8) default NULL,
  `BeamE` float(16,8) default NULL,
  `Collision` char(25) default NULL,
  `DetSetMask` bigint(20) unsigned default '0',
  `TrgSetup` bigint(20) unsigned default '0',
  `TrgMask` bigint(20) unsigned default '0',
  `ftype` int(11) default '0',
  `EntryDate` timestamp NOT NULL default '0000-00-00 00:00:00',
  `ExecDate` timestamp NOT NULL default '0000-00-00 00:00:00',
  `UpdateDate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `DiskLoc` int(11) default '0',
  `Chain` int(11) default '0',
  `XStatus1` int(11) default '0',
  `XStatus2` int(11) default '0',
  `Status` int(11) default '0',
  PRIMARY KEY  (`file`),
  KEY `runNumber` (`runNumber`),
  KEY `DetSetMask` (`DetSetMask`),
  KEY `TrgSetup` (`TrgSetup`),
  KEY `TrgMask` (`TrgMask`),
  KEY `ftype` (`ftype`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOChains`
-- 

CREATE TABLE `FOChains` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Label` (`Label`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FODetectorTypes`
-- 

CREATE TABLE `FODetectorTypes` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(50) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Label` (`Label`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOFileType`
-- 

CREATE TABLE `FOFileType` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(50) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Label` (`Label`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOLocations`
-- 

CREATE TABLE `FOLocations` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Label` (`Label`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOMessages`
-- 

CREATE TABLE `FOMessages` (
  `id` int(11) NOT NULL auto_increment,
  `Itime` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `Category` varchar(15) default NULL,
  `Message` varchar(80) default NULL,
  `Variablemsg` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `Category` (`Category`),
  KEY `Message` (`Message`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOruns`
-- 

CREATE TABLE `FOruns` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(8) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOTriggerBits`
-- 

CREATE TABLE `FOTriggerBits` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(50) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Label` (`Label`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `FOTriggerSetup`
-- 

CREATE TABLE `FOTriggerSetup` (
  `id` int(11) NOT NULL auto_increment,
  `Label` char(50) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Label` (`Label`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;