DROP TABLE IF EXISTS wafer_test;
CREATE TABLE wafer_test (
  id integer NOT NULL PRIMARY KEY,
  Wafer integer NOT NULL default '-1',
  Posw integer NOT NULL default '-1',
  yymmdd varchar(8) NOT NULL default '',
  BurnedId varchar(8) NOT NULL default '',
  ReadId varchar(8) NOT NULL default '',
  Burned1read0 varchar(20) NOT NULL default '',
  Burned0read1 varchar(20) NOT NULL default '',
  SCSN varchar(8) NOT NULL default '',
  RST_s_p varchar(4) NOT NULL default '',
  CLK varchar(8) NOT NULL default '',
  PRE varchar(8) NOT NULL default '',
  Rclk varchar(8) NOT NULL default '',
  Rpre varchar(8) NOT NULL default '',
  Rsc0in varchar(8) NOT NULL default '',
  Rsc1in varchar(8) NOT NULL default '',
  I_1V8a varchar(8) NOT NULL default '',
  I_1V8d varchar(8) NOT NULL default '',
  I_3V3d varchar(8) NOT NULL default '',
  INTTST varchar(10) NOT NULL default '',
  DMEM varchar(10) NOT NULL default '',
  NIOUT varchar(24) NOT NULL default '',
  LUT_EBF varchar(4) NOT NULL default '',
  FPD varchar(12) NOT NULL default '',
  RestF varchar(12) NOT NULL default '',
  A_DDS0 float NOT NULL default '-1',
  A_DDS2 float NOT NULL default '-1',
  A_DDS4 float NOT NULL default '-1',
  A_DDS6 float NOT NULL default '-1',
  A_DDS8 float NOT NULL default '-1',
  A_DDS10 float NOT NULL default '-1',
  A_DDS12 float NOT NULL default '-1',
  A_DDS14 float NOT NULL default '-1',
  A_DDS16 float NOT NULL default '-1',
  A_DDS18 float NOT NULL default '-1',
  ADC_DDS varchar(12) NOT NULL default '',
  ADC_TM varchar(12) NOT NULL default '',
  trtCode varchar(64) NOT NULL default '',
  LCcode_function varchar(64) NOT NULL default '',
  Remark varchar(128) NOT NULL default '',
  PathToFile varchar(32) NOT NULL default '',
  SVNver varchar(8) NOT NULL default '',
  BRDid varchar(16) NOT NULL default '',
  DMDELA varchar(4) NOT NULL default '',
  DMDELS varchar(4) NOT NULL default '',
  QDA_MIN_CONST varchar(4) NOT NULL default '',
  DDS_AMP_Vpp varchar(8) NOT NULL default '',
  plot varchar(4) NOT NULL default ''
-- unfortunately, the following principial constraint cannot be
-- enforced at the db level due to inconsistencies in the way tables are filled
--  , FOREIGN KEY (ReadId) REFERENCES mcm (laser_num) ON DELETE RESTRICT
);
