-- phpMyAdmin SQL Dump
-- version 4.0.10.10
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 20, 2015 at 06:50 PM
-- Server version: 5.6.27-log
-- PHP Version: 5.3.3

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `current_bci`
--

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

--
-- Table structure for table `Census`
--

CREATE TABLE IF NOT EXISTS `Census` (
  `CensusID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `PlotID` int(10) unsigned NOT NULL,
  `PlotCensusNumber` char(16) DEFAULT NULL,
  `StartDate` date DEFAULT NULL,
  `EndDate` date DEFAULT NULL,
  `Description` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`CensusID`),
  KEY `Ref610` (`PlotID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `CensusQuadrat`
--

CREATE TABLE IF NOT EXISTS `CensusQuadrat` (
  `CensusID` int(10) unsigned NOT NULL,
  `QuadratID` int(10) unsigned NOT NULL,
  `CensusQuadratID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`CensusQuadratID`),
  KEY `Ref534` (`CensusID`),
  KEY `QuadratID` (`QuadratID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Stand-in structure for view `CensusView`
--
CREATE TABLE IF NOT EXISTS `CensusView` (
`CensusID` int(10) unsigned
,`PlotID` int(10) unsigned
,`PlotCensusNumber` char(16)
,`StartDate` date
,`EndDate` date
,`Description` varchar(128)
);
-- --------------------------------------------------------

--
-- Table structure for table `Coordinates`
--

CREATE TABLE IF NOT EXISTS `Coordinates` (
  `CoorID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `FeatureID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `GX` decimal(16,5) DEFAULT NULL,
  `GY` decimal(16,5) DEFAULT NULL,
  `GZ` decimal(16,5) DEFAULT NULL,
  `PX` decimal(16,5) DEFAULT NULL,
  `PY` decimal(16,5) DEFAULT NULL,
  `PZ` decimal(16,5) DEFAULT NULL,
  `QX` decimal(16,5) DEFAULT NULL,
  `QY` decimal(16,5) DEFAULT NULL,
  `QZ` decimal(16,5) DEFAULT NULL,
  `CoordinateNo` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`CoorID`),
  KEY `FeatureID` (`FeatureID`),
  KEY `PlotID` (`PlotID`),
  KEY `QuadratID` (`QuadratID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `Country`
--

CREATE TABLE IF NOT EXISTS `Country` (
  `CountryID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `CountryName` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`CountryID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `CurrentObsolete`
--

CREATE TABLE IF NOT EXISTS `CurrentObsolete` (
  `SpeciesID` int(10) unsigned NOT NULL,
  `ObsoleteSpeciesID` int(10) unsigned NOT NULL,
  `ChangeDate` datetime NOT NULL,
  `ChangeCodeID` int(10) unsigned NOT NULL,
  `ChangeNote` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`SpeciesID`,`ObsoleteSpeciesID`,`ChangeDate`),
  KEY `Ref32191` (`ChangeCodeID`),
  KEY `Ref92192` (`SpeciesID`),
  KEY `Ref92212` (`ObsoleteSpeciesID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `DataCollection`
--

CREATE TABLE IF NOT EXISTS `DataCollection` (
  `CensusID` int(10) unsigned NOT NULL,
  `StartDate` date DEFAULT NULL,
  `EndDate` date DEFAULT NULL,
  `DataCollectionID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `PersonnelRoleID` int(10) unsigned NOT NULL,
  `QuadratID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`DataCollectionID`),
  KEY `Ref1743` (`CensusID`),
  KEY `QuadratID` (`QuadratID`),
  KEY `PersonnelRoleID` (`PersonnelRoleID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `DBH`
--

CREATE TABLE IF NOT EXISTS `DBH` (
  `CensusID` int(10) unsigned NOT NULL,
  `StemID` int(10) unsigned NOT NULL,
  `DBH` float DEFAULT NULL,
  `HOM` char(16) DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `DBHID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Comments` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`DBHID`),
  KEY `Ref549` (`CensusID`),
  KEY `Ref1951` (`StemID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `DBHAttributes`
--

CREATE TABLE IF NOT EXISTS `DBHAttributes` (
  `TSMID` int(10) unsigned NOT NULL,
  `DBHID` int(10) unsigned DEFAULT NULL,
  `DBHAttID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`DBHAttID`),
  KEY `Ref2053` (`TSMID`),
  KEY `DBHID` (`DBHID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Family`
--

CREATE TABLE IF NOT EXISTS `Family` (
  `FamilyID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Family` char(32) DEFAULT NULL,
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
  PRIMARY KEY (`FamilyID`),
  KEY `Ref84175` (`ReferenceID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Features`
--

CREATE TABLE IF NOT EXISTS `Features` (
  `FeatureID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `FeatureTypeID` int(10) unsigned NOT NULL,
  `Name` varchar(32) NOT NULL,
  `ShortDescrip` varchar(32) DEFAULT NULL,
  `LongDescrip` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`FeatureID`),
  KEY `FeatureTypeID` (`FeatureTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `FeatureTypes`
--

CREATE TABLE IF NOT EXISTS `FeatureTypes` (
  `FeatureTypeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Type` varchar(32) NOT NULL,
  PRIMARY KEY (`FeatureTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `Genus`
--

CREATE TABLE IF NOT EXISTS `Genus` (
  `GenusID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Genus` char(32) DEFAULT NULL,
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
  `Authority` char(32) DEFAULT NULL,
  `FamilyID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`GenusID`),
  KEY `Ref2868` (`FamilyID`),
  KEY `Ref84176` (`ReferenceID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `Log`
--

CREATE TABLE IF NOT EXISTS `Log` (
  `LogID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `PersonnelID` smallint(5) unsigned DEFAULT NULL,
  `ChangedTable` varchar(32) NOT NULL,
  `PrimaryKey` varchar(32) NOT NULL,
  `ChangedColumn` varchar(32) NOT NULL,
  `ChangeDate` date DEFAULT NULL,
  `ChangeTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Description` varchar(256) DEFAULT NULL,
  `Action` enum('I','D','U') NOT NULL,
  `Old` varchar(512) NOT NULL,
  `New` varchar(512) NOT NULL,
  PRIMARY KEY (`LogID`),
  KEY `PersonnelID` (`PersonnelID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `LogMAttrHistoryd`
--

CREATE TABLE IF NOT EXISTS `LogMAttrHistoryd` (
  `LogMAttrHistoryID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MeasureID` int(10) unsigned NOT NULL,
  `CensusID` int(10) unsigned NOT NULL,
  `TSMID` int(10) unsigned NOT NULL,
  `DateOfChange` date DEFAULT NULL,
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`LogMAttrHistoryID`),
  KEY `Ref21225` (`MeasureID`,`CensusID`,`TSMID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `LogMeasurementHistoryd`
--

CREATE TABLE IF NOT EXISTS `LogMeasurementHistoryd` (
  `MeasureID` int(10) unsigned NOT NULL,
  `CensusID` int(10) unsigned NOT NULL,
  `MeasurementHistoryID` int(10) unsigned NOT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `DateOfChange` date NOT NULL,
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  PRIMARY KEY (`MeasureID`,`CensusID`,`MeasurementHistoryID`),
  KEY `Ref287` (`MeasureID`,`CensusID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `LogSpeciesInventory`
--

CREATE TABLE IF NOT EXISTS `LogSpeciesInventory` (
  `SpeciesInvHistID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `SpeciesInvID` int(10) unsigned NOT NULL,
  `CensusID` int(10) unsigned NOT NULL,
  `PlotID` int(10) unsigned NOT NULL,
  `SpeciesID` int(10) unsigned NOT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `DateOfChange` date DEFAULT NULL,
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`SpeciesInvHistID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `LogTreeHistoryd`
--

CREATE TABLE IF NOT EXISTS `LogTreeHistoryd` (
  `TreeID` int(10) unsigned NOT NULL,
  `TreeHistoryID` int(10) unsigned NOT NULL,
  `ChangeCodeID` int(10) unsigned DEFAULT NULL,
  `ChangeDate` date DEFAULT NULL,
  `ChangeDescription` varchar(128) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `Tag` char(10) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`TreeID`,`TreeHistoryID`),
  KEY `Ref186` (`TreeID`),
  KEY `Ref32221` (`ChangeCodeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `Measurement`
--

CREATE TABLE IF NOT EXISTS `Measurement` (
  `MeasureID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `CensusID` int(10) unsigned NOT NULL,
  `TreeID` int(10) unsigned NOT NULL,
  `StemID` int(10) unsigned NOT NULL,
  `MeasurementTypeID` int(10) unsigned NOT NULL,
  `Measure` varchar(256) NOT NULL,
  `ExactDate` date NOT NULL,
  `Comments` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`MeasureID`),
  KEY `CensusID` (`CensusID`),
  KEY `TreeID` (`TreeID`),
  KEY `StemID` (`StemID`),
  KEY `MeasurementTypeID` (`MeasurementTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `MeasurementAttributes`
--

CREATE TABLE IF NOT EXISTS `MeasurementAttributes` (
  `MAttID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MeasureID` int(10) unsigned NOT NULL,
  `TSMID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`MAttID`),
  KEY `MeasureID` (`MeasureID`),
  KEY `TSMID` (`TSMID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `MeasurementType`
--

CREATE TABLE IF NOT EXISTS `MeasurementType` (
  `MeasurementTypeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `UOM` varchar(32) NOT NULL,
  `Type` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`MeasurementTypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `Personnel`
--

CREATE TABLE IF NOT EXISTS `Personnel` (
  `PersonnelID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `FirstName` varchar(32) DEFAULT NULL,
  `LastName` varchar(32) NOT NULL,
  PRIMARY KEY (`PersonnelID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `PersonnelRole`
--

CREATE TABLE IF NOT EXISTS `PersonnelRole` (
  `PersonnelRoleID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `PersonnelID` smallint(5) unsigned NOT NULL,
  `RoleID` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`PersonnelRoleID`),
  KEY `RoleID` (`RoleID`),
  KEY `PersonnelID` (`PersonnelID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `Quadrat`
--

CREATE TABLE IF NOT EXISTS `Quadrat` (
  `PlotID` int(10) unsigned NOT NULL,
  `QuadratName` char(8) DEFAULT NULL,
  `Area` float unsigned DEFAULT NULL,
  `IsStandardShape` enum('Y','N') NOT NULL,
  `QuadratID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`QuadratID`),
  KEY `Ref69` (`PlotID`),
  KEY `QuadratName` (`QuadratName`,`PlotID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `Reference`
--

CREATE TABLE IF NOT EXISTS `Reference` (
  `ReferenceID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `PublicationTitle` varchar(64) DEFAULT NULL,
  `FullReference` varchar(256) DEFAULT NULL,
  `DateofPublication` date DEFAULT NULL,
  PRIMARY KEY (`ReferenceID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `RemeasAttribs`
--

CREATE TABLE IF NOT EXISTS `RemeasAttribs` (
  `TSMID` int(10) unsigned NOT NULL,
  `RemeasureID` int(10) unsigned NOT NULL,
  `RmAttID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`RmAttID`),
  KEY `Ref2073` (`TSMID`),
  KEY `RemeasureID` (`RemeasureID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Remeasurement`
--

CREATE TABLE IF NOT EXISTS `Remeasurement` (
  `CensusID` int(10) unsigned NOT NULL,
  `StemID` int(10) unsigned NOT NULL,
  `DBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `RemeasureID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`RemeasureID`),
  KEY `Ref1957` (`StemID`),
  KEY `Ref5106` (`CensusID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `RoleReference`
--

CREATE TABLE IF NOT EXISTS `RoleReference` (
  `RoleID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `Description` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`RoleID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Site`
--

CREATE TABLE IF NOT EXISTS `Site` (
  `PlotID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `PlotName` char(64) DEFAULT NULL,
  `LocationName` varchar(128) DEFAULT NULL,
  `CountryID` smallint(5) unsigned NOT NULL,
  `ShapeOfSite` char(32) DEFAULT NULL,
  `DescriptionOfSite` varchar(128) DEFAULT NULL,
  `Area` float unsigned NOT NULL,
  `QDimX` float unsigned NOT NULL,
  `QDimY` float unsigned NOT NULL,
  `GUOM` varchar(32) NOT NULL,
  `GZUOM` varchar(32) NOT NULL,
  `PUOM` varchar(32) NOT NULL,
  `QUOM` varchar(32) NOT NULL,
  `GCoorCollected` varchar(32) DEFAULT NULL,
  `PCoorCollected` varchar(32) DEFAULT NULL,
  `QCoorCollected` varchar(32) DEFAULT NULL,
  `IsStandardSize` enum('Y','N') DEFAULT NULL,
  PRIMARY KEY (`PlotID`),
  KEY `Ref87173` (`CountryID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Species`
--

CREATE TABLE IF NOT EXISTS `Species` (
  `SpeciesID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `CurrentTaxonFlag` smallint(6) DEFAULT NULL,
  `ObsoleteTaxonFlag` smallint(6) DEFAULT NULL,
  `GenusID` int(10) unsigned NOT NULL,
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
  `SpeciesName` char(64) DEFAULT NULL,
  `Mnemonic` char(10) DEFAULT NULL,
  `Authority` varchar(128) DEFAULT NULL,
  `IDLEVEL` enum('subspecies','species','superspecies','genus','family','multiple','none','variety') DEFAULT NULL,
  `FieldFamily` char(32) DEFAULT NULL,
  `Description` varchar(128) DEFAULT NULL,
  `Lifeform` enum('Emergent Tree','Tree','Midcanopy Tree','Understory Tree','Shrub','Herb','Liana') DEFAULT NULL,
  `LocalName` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`SpeciesID`),
  KEY `Ref26208` (`GenusID`),
  KEY `Ref84209` (`ReferenceID`),
  KEY `Mnemonic` (`Mnemonic`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `SpeciesInventory`
--

CREATE TABLE IF NOT EXISTS `SpeciesInventory` (
  `SpeciesInvID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `CensusID` int(10) unsigned NOT NULL,
  `PlotID` int(10) unsigned NOT NULL,
  `SpeciesID` int(10) unsigned NOT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`SpeciesInvID`),
  KEY `Ref92198` (`SpeciesID`),
  KEY `Ref93199` (`SubSpeciesID`),
  KEY `Ref5222` (`CensusID`),
  KEY `Ref642` (`PlotID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Specimen`
--

CREATE TABLE IF NOT EXISTS `Specimen` (
  `SpecimenID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Collector` char(64) DEFAULT NULL,
  `SpecimenNumber` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned NOT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `Herbarium` char(32) DEFAULT NULL,
  `Voucher` smallint(5) unsigned DEFAULT NULL,
  `CollectionDate` date DEFAULT NULL,
  `DeterminedBy` char(64) DEFAULT NULL,
  `Description` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`SpecimenID`),
  KEY `Ref93194` (`SubSpeciesID`),
  KEY `Ref92196` (`SpeciesID`),
  KEY `Ref1171` (`TreeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Stem`
--

CREATE TABLE IF NOT EXISTS `Stem` (
  `StemID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned NOT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `StemDescription` varchar(128) DEFAULT NULL,
  `QuadratID` int(10) unsigned NOT NULL,
  `StemNumber` int(10) unsigned NOT NULL,
  `Moved` enum('Y','N') NOT NULL DEFAULT 'N',
  `GX` decimal(16,5) DEFAULT NULL,
  `GY` decimal(16,5) DEFAULT NULL,
  `GZ` decimal(16,5) DEFAULT NULL,
  `PX` decimal(16,5) DEFAULT NULL,
  `PY` decimal(16,5) DEFAULT NULL,
  `PZ` decimal(16,5) DEFAULT NULL,
  `QX` decimal(16,5) DEFAULT NULL,
  `QY` decimal(16,5) DEFAULT NULL,
  `QZ` decimal(16,5) DEFAULT NULL,
  PRIMARY KEY (`StemID`),
  KEY `Ref150` (`TreeID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `SubSpecies`
--

CREATE TABLE IF NOT EXISTS `SubSpecies` (
  `SubSpeciesID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `SpeciesID` int(10) unsigned NOT NULL,
  `CurrentTaxonFlag` smallint(6) DEFAULT NULL,
  `ObsoleteTaxonFlag` smallint(6) DEFAULT NULL,
  `SubSpeciesName` char(64) DEFAULT NULL,
  `Mnemonic` char(10) DEFAULT NULL,
  `Authority` varchar(128) DEFAULT NULL,
  `InfraSpecificLevel` char(32) DEFAULT NULL,
  PRIMARY KEY (`SubSpeciesID`),
  KEY `Ref92193` (`SpeciesID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TAX2temp`
--

CREATE TABLE IF NOT EXISTS `TAX2temp` (
  `SpeciesID` int(11) NOT NULL,
  `ObsoleteSpeciesID` int(11) NOT NULL,
  `ObsoleteGenusName` char(32) DEFAULT NULL,
  `ObsoleteSpeciesName` char(64) DEFAULT NULL,
  `ObsoleteGenSpeName` char(128) DEFAULT NULL,
  `Description` char(128) DEFAULT NULL,
  `ChangeDate` date NOT NULL DEFAULT '0000-00-00',
  `Family` char(32) DEFAULT NULL,
  `Genus` char(32) DEFAULT NULL,
  `SpeciesName` char(64) DEFAULT NULL,
  `Authority` char(128) DEFAULT NULL,
  `IDLevel` char(8) DEFAULT NULL,
  PRIMARY KEY (`SpeciesID`,`ObsoleteSpeciesID`,`ChangeDate`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `TAX3temp`
--

CREATE TABLE IF NOT EXISTS `TAX3temp` (
  `PlotSpeciesID` int(11) NOT NULL AUTO_INCREMENT,
  `PlotID` int(11) NOT NULL,
  `SpeciesID` int(11) NOT NULL,
  `SubSpeciesID` int(11) DEFAULT NULL,
  PRIMARY KEY (`PlotSpeciesID`),
  KEY `TAX3Plot` (`PlotID`,`SpeciesID`,`SubSpeciesID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempAllTrees`
--

CREATE TABLE IF NOT EXISTS `TempAllTrees` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `DBHID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `Tagged` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `TempBigTrees`
--

CREATE TABLE IF NOT EXISTS `TempBigTrees` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempBigTreesError`
--

CREATE TABLE IF NOT EXISTS `TempBigTreesError` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `TempCodes`
--

CREATE TABLE IF NOT EXISTS `TempCodes` (
  `codes` char(12) DEFAULT NULL,
  `description` varchar(128) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `TempLocations`
--

CREATE TABLE IF NOT EXISTS `TempLocations` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTag` (`Tag`),
  KEY `indexSTemTag` (`Tag`,`StemTag`),
  KEY `indexTreeID` (`TreeID`),
  KEY `indexQuadratName` (`QuadratName`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempLocationsError`
--

CREATE TABLE IF NOT EXISTS `TempLocationsError` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTag` (`Tag`),
  KEY `indexSTemTag` (`Tag`,`StemTag`),
  KEY `indexTreeID` (`TreeID`),
  KEY `indexQuadratName` (`QuadratName`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempMultiStems`
--

CREATE TABLE IF NOT EXISTS `TempMultiStems` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempMultiStemsError`
--

CREATE TABLE IF NOT EXISTS `TempMultiStemsError` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `TempNewPlants`
--

CREATE TABLE IF NOT EXISTS `TempNewPlants` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `TempNewPlantsError`
--

CREATE TABLE IF NOT EXISTS `TempNewPlantsError` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempOldTrees`
--

CREATE TABLE IF NOT EXISTS `TempOldTrees` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempOldTreesError`
--

CREATE TABLE IF NOT EXISTS `TempOldTreesError` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TreeID` int(10) unsigned DEFAULT NULL,
  `Tag` varchar(10) DEFAULT NULL,
  `StemID` int(10) unsigned DEFAULT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `Subquad` int(10) unsigned DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `PrimaryStem` varchar(20) DEFAULT NULL,
  `X` float DEFAULT NULL,
  `Y` float DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `OldDBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `OldHOM` float DEFAULT NULL,
  `Codes` varchar(50) DEFAULT NULL,
  `OldCodes` varchar(50) DEFAULT NULL,
  `Comments` varchar(256) DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `OldTrees` varchar(10) DEFAULT NULL,
  `BigTrees` varchar(10) DEFAULT NULL,
  `Extra1` varchar(80) DEFAULT NULL,
  `Extra2` varchar(80) DEFAULT NULL,
  `Extra3` varchar(80) DEFAULT NULL,
  `Extra4` varchar(80) DEFAULT NULL,
  `Extra5` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexTagStemTag` (`Tag`,`StemTag`),
  KEY `indexTreeIDStemID` (`TreeID`,`StemID`),
  KEY `indexQuadratNamePlotID` (`QuadratName`,`PlotID`),
  KEY `indexMnemonic` (`Mnemonic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempPersonnelInfo`
--

CREATE TABLE IF NOT EXISTS `TempPersonnelInfo` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `QuadratName` varchar(12) DEFAULT NULL,
  `QuadratID` int(10) unsigned DEFAULT NULL,
  `PersonnelID` smallint(5) unsigned DEFAULT NULL,
  `Form` varchar(32) DEFAULT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  `CensusID` int(10) unsigned DEFAULT NULL,
  `PlotCensusNumber` int(10) unsigned DEFAULT NULL,
  `Role` varchar(128) DEFAULT NULL,
  `RoleID` smallint(5) unsigned DEFAULT NULL,
  `DateWorked` date DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  `PersonnelRoleID` int(4) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexQuadratName` (`QuadratName`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `TempQuadrat`
--

CREATE TABLE IF NOT EXISTS `TempQuadrat` (
  `QuadratID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `QuadratName` char(8) DEFAULT NULL,
  `StartX` float DEFAULT NULL,
  `StartY` float DEFAULT NULL,
  `DimX` float DEFAULT NULL,
  `DimY` float DEFAULT NULL,
  `CensusID` int(10) unsigned NOT NULL,
  `PlotCensusNumber` int(10) unsigned NOT NULL,
  `PlotID` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`QuadratID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `TempQuadratDates`
--

CREATE TABLE IF NOT EXISTS `TempQuadratDates` (
  `TempQuadID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `QuadratName` varchar(12) DEFAULT NULL,
  `PrevDate` date DEFAULT NULL,
  PRIMARY KEY (`TempQuadID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TempSpecies`
--

CREATE TABLE IF NOT EXISTS `TempSpecies` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `CurrentTaxonFlag` smallint(6) DEFAULT NULL,
  `ObsoleteTaxonFlag` smallint(6) DEFAULT NULL,
  `Genus` varchar(32) DEFAULT NULL,
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
  `SpeciesName` char(64) DEFAULT NULL,
  `Mnemonic` char(10) DEFAULT NULL,
  `Authority` varchar(128) DEFAULT NULL,
  `IDLevel` enum('subspecies','species','superspecies','genus','family','multiple','none','variety') DEFAULT NULL,
  `GenusID` int(10) DEFAULT NULL,
  `SpeciesID` int(10) DEFAULT NULL,
  `Family` char(32) DEFAULT NULL,
  `FieldFamily` char(32) DEFAULT NULL,
  `Description` varchar(128) DEFAULT NULL,
  `Lifeform` enum('Emergent Tree','Tree','Midcanopy Tree','Understory Tree','Shrub','Herb','Liana') DEFAULT NULL,
  `LocalName` varchar(128) DEFAULT NULL,
  `SubSpecies` char(64) DEFAULT NULL,  
  `InfraspecificLevel` char(10) DEFAULT NULL, 
  `Errors` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `Genus` (`Genus`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;

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

--
-- Table structure for table `TempSpeciesError`
--

CREATE TABLE IF NOT EXISTS `TempSpeciesError` (
  `TempID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Mnemonic` varchar(10) DEFAULT NULL,
  `Genus` varchar(32) DEFAULT NULL,
  `SpeciesName` varchar(64) DEFAULT NULL,
  `FieldFamily` varchar(32) DEFAULT NULL,
  `Authority` varchar(128) DEFAULT NULL,
  `IDLevel` varchar(8) DEFAULT NULL,
  `GenusID` int(10) DEFAULT NULL,
  `SpeciesID` int(10) DEFAULT NULL,
  `Family` char(32) DEFAULT NULL,
  `Errors` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`TempID`),
  KEY `indexGenus` (`Genus`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `Tree`
--

CREATE TABLE IF NOT EXISTS `Tree` (
  `TreeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Tag` char(10) DEFAULT NULL,
  `SpeciesID` int(10) unsigned NOT NULL,
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`TreeID`),
  KEY `Ref92217` (`SpeciesID`),
  KEY `Ref93219` (`SubSpeciesID`),
  KEY `Tag` (`Tag`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TreeAttributes`
--

CREATE TABLE IF NOT EXISTS `TreeAttributes` (
  `CensusID` int(10) unsigned NOT NULL,
  `TreeID` int(10) unsigned NOT NULL,
  `TSMID` int(10) unsigned NOT NULL,
  `TAttID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`TAttID`),
  KEY `Ref163` (`TreeID`),
  KEY `Ref2064` (`TSMID`),
  KEY `Ref5107` (`CensusID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `TreeTaxChange`
--

CREATE TABLE IF NOT EXISTS `TreeTaxChange` (
  `ChangeCodeID` int(10) unsigned NOT NULL,
  `Description` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`ChangeCodeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `TSMAttributes`
--

CREATE TABLE IF NOT EXISTS `TSMAttributes` (
  `TSMID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `TSMCode` char(10) NOT NULL,
  `Description` varchar(128) NOT NULL,
  `Status` enum('alive','alive-not measured','dead','not found','broken below') DEFAULT NULL,
  PRIMARY KEY (`TSMID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;

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

--
-- Table structure for table `ViewFullTable`
--

CREATE TABLE IF NOT EXISTS `ViewFullTable` (
  `DBHID` int(11) NOT NULL,
  `PlotID` int(11) NOT NULL,
  `Plot` varchar(35) DEFAULT NULL,
  `Family` char(32) DEFAULT NULL,
  `GenusSpecies` char(64) DEFAULT NULL,
  `Genus` char(32) DEFAULT NULL,
  `SpeciesName` char(64) DEFAULT NULL,
  `SubSpeciesName` char(64) DEFAULT NULL,
  `SpeciesID` int(10) unsigned DEFAULT NULL,
  `Mnemonic` char(10) DEFAULT NULL,
  `QuadratID` int(11) NOT NULL,
  `QuadratName` varchar(12) DEFAULT NULL,
  `QX` decimal(16,5) DEFAULT NULL,
  `QY` decimal(16,5) DEFAULT NULL,
  `PX` decimal(16,5) DEFAULT NULL,
  `PY` decimal(16,5) DEFAULT NULL,
  `TreeID` int(11) NOT NULL,
  `Tag` char(10) DEFAULT NULL,
  `StemID` int(11) NOT NULL,
  `StemNumber` int(11) NOT NULL,
  `StemTag` varchar(32) DEFAULT NULL,
  `Moved` enum('Y','N') NOT NULL,
  `PrimaryStem` char(20) DEFAULT NULL,
  `CensusID` int(11) NOT NULL,
  `PlotCensusNumber` int(11) DEFAULT NULL,
  `DBH` float DEFAULT NULL,
  `HOM` float DEFAULT NULL,
  `ExactDate` date DEFAULT NULL,
  `ListOfTSM` varchar(256) DEFAULT NULL,
  `HighHOM` tinyint(1) DEFAULT NULL,
  `MainStem` tinyint(1) DEFAULT NULL,
  `Status` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`DBHID`),
  KEY `Genus` (`Genus`(5)),
  KEY `SpeciesName` (`SpeciesName`(5)),
  KEY `SpeciesID` (`SpeciesID`),
  KEY `QuadratName` (`QuadratName`(4)),
  KEY `PlotCensusNumber` (`PlotCensusNumber`),
  KEY `DBH` (`DBH`),
  KEY `ForDataEntry` (`TreeID`,`StemID`,`CensusID`,`DBHID`),
  KEY `ForDataScreening` (`Tag`,`StemTag`,`PlotID`),
  KEY `DataScreening` (`TreeID`,`StemID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ViewTaxonomy`
--

CREATE TABLE IF NOT EXISTS `ViewTaxonomy` (
  `SpeciesID` int(11) NOT NULL,
  `SubspeciesID` int(11) NOT NULL DEFAULT '0',
  `Family` char(32) DEFAULT NULL,
  `Genus` char(32) DEFAULT NULL,
  `Mnemonic` char(10) DEFAULT NULL,
  `SpeciesName` char(64) DEFAULT NULL,
  `SubspeciesName` char(64) DEFAULT NULL,
  `IDLevel` char(32) DEFAULT NULL,
  `Authority` char(124) DEFAULT NULL,
  `ListOfOldNames` varchar(255) DEFAULT NULL,
  `NumberOfHerbarium` int(11) DEFAULT NULL,
  `ListOfHerbarium` varchar(255) DEFAULT NULL,
  `Description` varchar(128) DEFAULT NULL,
  `LocalName` varchar(128) DEFAULT NULL,
  `ReferenceID` char(15) DEFAULT NULL,
  `FieldFamily` char(32) DEFAULT NULL,
  `Lifeform` char(32) DEFAULT NULL,
  PRIMARY KEY (`SpeciesID`,`SubspeciesID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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



--
-- Constraints for dumped tables
--

--
-- Constraints for table `Census`
--
ALTER TABLE `Census`
  ADD CONSTRAINT `Census_ibfk_1` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`);

--
-- Constraints for table `CensusQuadrat`
--
ALTER TABLE `CensusQuadrat`
  ADD CONSTRAINT `CensusQuadrat_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `CensusQuadrat_ibfk_2` FOREIGN KEY (`QuadratID`) REFERENCES `Quadrat` (`QuadratID`);

--
-- Constraints for table `Coordinates`
--
ALTER TABLE `Coordinates`
  ADD CONSTRAINT `Coordinates_ibfk_1` FOREIGN KEY (`FeatureID`) REFERENCES `Features` (`FeatureID`),
  ADD CONSTRAINT `Coordinates_ibfk_2` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`),
  ADD CONSTRAINT `Coordinates_ibfk_3` FOREIGN KEY (`QuadratID`) REFERENCES `Quadrat` (`QuadratID`);

--
-- Constraints for table `CurrentObsolete`
--
ALTER TABLE `CurrentObsolete`
  ADD CONSTRAINT `CurrentObsolete_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
  ADD CONSTRAINT `CurrentObsolete_ibfk_2` FOREIGN KEY (`ObsoleteSpeciesID`) REFERENCES `Species` (`SpeciesID`),
  ADD CONSTRAINT `CurrentObsolete_ibfk_3` FOREIGN KEY (`ChangeCodeID`) REFERENCES `TreeTaxChange` (`ChangeCodeID`);

--
-- Constraints for table `DataCollection`
--
ALTER TABLE `DataCollection`
  ADD CONSTRAINT `DataCollection_ibfk_4` FOREIGN KEY (`QuadratID`) REFERENCES `Quadrat` (`QuadratID`),
  ADD CONSTRAINT `DataCollection_ibfk_5` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `DataCollection_ibfk_6` FOREIGN KEY (`PersonnelRoleID`) REFERENCES `PersonnelRole` (`PersonnelRoleID`);

--
-- Constraints for table `DBH`
--
ALTER TABLE `DBH`
  ADD CONSTRAINT `DBH_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `DBH_ibfk_2` FOREIGN KEY (`StemID`) REFERENCES `Stem` (`StemID`);

--
-- Constraints for table `DBHAttributes`
--
ALTER TABLE `DBHAttributes`
  ADD CONSTRAINT `DBHAttributes_ibfk_2` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`),
  ADD CONSTRAINT `DBHAttributes_ibfk_3` FOREIGN KEY (`DBHID`) REFERENCES `DBH` (`DBHID`);

--
-- Constraints for table `Family`
--
ALTER TABLE `Family`
  ADD CONSTRAINT `Family_ibfk_1` FOREIGN KEY (`ReferenceID`) REFERENCES `Reference` (`ReferenceID`);

--
-- Constraints for table `Features`
--
ALTER TABLE `Features`
  ADD CONSTRAINT `Features_ibfk_1` FOREIGN KEY (`FeatureTypeID`) REFERENCES `FeatureTypes` (`FeatureTypeID`);

--
-- Constraints for table `Genus`
--
ALTER TABLE `Genus`
  ADD CONSTRAINT `Genus_ibfk_1` FOREIGN KEY (`FamilyID`) REFERENCES `Family` (`FamilyID`),
  ADD CONSTRAINT `Genus_ibfk_2` FOREIGN KEY (`ReferenceID`) REFERENCES `Reference` (`ReferenceID`);

--
-- Constraints for table `Log`
--
ALTER TABLE `Log`
  ADD CONSTRAINT `Log_ibfk_1` FOREIGN KEY (`PersonnelID`) REFERENCES `Personnel` (`PersonnelID`);

--
-- Constraints for table `Measurement`
--
ALTER TABLE `Measurement`
  ADD CONSTRAINT `Measurement_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `Measurement_ibfk_2` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`),
  ADD CONSTRAINT `Measurement_ibfk_3` FOREIGN KEY (`StemID`) REFERENCES `Stem` (`StemID`),
  ADD CONSTRAINT `Measurement_ibfk_4` FOREIGN KEY (`MeasurementTypeID`) REFERENCES `MeasurementType` (`MeasurementTypeID`);

--
-- Constraints for table `MeasurementAttributes`
--
ALTER TABLE `MeasurementAttributes`
  ADD CONSTRAINT `MeasurementAttributes_ibfk_1` FOREIGN KEY (`MeasureID`) REFERENCES `Measurement` (`MeasureID`),
  ADD CONSTRAINT `MeasurementAttributes_ibfk_3` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`);

--
-- Constraints for table `PersonnelRole`
--
ALTER TABLE `PersonnelRole`
  ADD CONSTRAINT `PersonnelRole_ibfk_1` FOREIGN KEY (`RoleID`) REFERENCES `RoleReference` (`RoleID`),
  ADD CONSTRAINT `PersonnelRole_ibfk_2` FOREIGN KEY (`PersonnelID`) REFERENCES `Personnel` (`PersonnelID`);

--
-- Constraints for table `Quadrat`
--
ALTER TABLE `Quadrat`
  ADD CONSTRAINT `Quadrat_ibfk_1` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`);

--
-- Constraints for table `RemeasAttribs`
--
ALTER TABLE `RemeasAttribs`
  ADD CONSTRAINT `RemeasAttribs_ibfk_2` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`),
  ADD CONSTRAINT `RemeasAttribs_ibfk_3` FOREIGN KEY (`RemeasureID`) REFERENCES `Remeasurement` (`RemeasureID`);

--
-- Constraints for table `Remeasurement`
--
ALTER TABLE `Remeasurement`
  ADD CONSTRAINT `Remeasurement_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `Remeasurement_ibfk_3` FOREIGN KEY (`StemID`) REFERENCES `Stem` (`StemID`);

--
-- Constraints for table `Site`
--
ALTER TABLE `Site`
  ADD CONSTRAINT `Site_ibfk_1` FOREIGN KEY (`CountryID`) REFERENCES `Country` (`CountryID`);

--
-- Constraints for table `Species`
--
ALTER TABLE `Species`
  ADD CONSTRAINT `Species_ibfk_1` FOREIGN KEY (`GenusID`) REFERENCES `Genus` (`GenusID`);

--
-- Constraints for table `SpeciesInventory`
--
ALTER TABLE `SpeciesInventory`
  ADD CONSTRAINT `SpeciesInventory_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `SpeciesInventory_ibfk_2` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`),
  ADD CONSTRAINT `SpeciesInventory_ibfk_3` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
  ADD CONSTRAINT `SpeciesInventory_ibfk_4` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`);

--
-- Constraints for table `Specimen`
--
ALTER TABLE `Specimen`
  ADD CONSTRAINT `Specimen_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
  ADD CONSTRAINT `Specimen_ibfk_2` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`),
  ADD CONSTRAINT `Specimen_ibfk_3` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`);

--
-- Constraints for table `Stem`
--
ALTER TABLE `Stem`
  ADD CONSTRAINT `Stem_ibfk_1` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`);

--
-- Constraints for table `SubSpecies`
--
ALTER TABLE `SubSpecies`
  ADD CONSTRAINT `SubSpecies_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`);

--
-- Constraints for table `Tree`
--
ALTER TABLE `Tree`
  ADD CONSTRAINT `Tree_ibfk_2` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
  ADD CONSTRAINT `Tree_ibfk_3` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`);

--
-- Constraints for table `TreeAttributes`
--
ALTER TABLE `TreeAttributes`
  ADD CONSTRAINT `TreeAttributes_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
  ADD CONSTRAINT `TreeAttributes_ibfk_2` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`),
  ADD CONSTRAINT `TreeAttributes_ibfk_3` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
