Project

General

Profile

« Previous | Next » 

Revision 11705

copyright scrub: inputs/: removed data provider-owned schema and documentation files, which are not BIEN copyright and should not be part of what is submitted for open-sourcing. these files will remain accessible via the web interface (fs.vegpath.org), but will not be in the repository.

View differences:

inputs/bien2_traits/bien2_staging.schema.sql
1
SET standard_conforming_strings = off;
2
SET escape_string_warning = off;
3
-- MySQL dump 10.13  Distrib 5.5.28, for debian-linux-gnu (x86_64)
4
--
5
-- Host: localhost    Database: bien2_staging
6
-- ------------------------------------------------------
7
-- Server version	5.5.28-0ubuntu0.12.04.3
8

  
9
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12
SET NAMES 'latin1';
13
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14
/*!40103 SET TIME_ZONE='+00:00' */;
15
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,POSTGRESQL' */;
18
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19

  
20
--
21
-- Table structure for table "TraitObservation"
22
--
23

  
24
DROP TABLE IF EXISTS "TraitObservation";
25
/*!40101 SET @saved_cs_client     = @@character_set_client */;
26
/*!40101 SET character_set_client = utf8 */;
27
CREATE TABLE "TraitObservation" (
28
  "TraitObservationID" integer NOT NULL,
29
  "TaxonomyID" integer NOT NULL,
30
  "Family" varchar(100) DEFAULT NULL,
31
  "Genus" varchar(100) DEFAULT NULL,
32
  "SpecificEpithet" varchar(100) DEFAULT NULL,
33
  "InfraspecificRank" varchar(25) DEFAULT NULL,
34
  "InfraspecificEpithet" varchar(100) DEFAULT NULL,
35
  "Taxon" varchar(255) DEFAULT NULL,
36
  "AuthorOfScientificName" varchar(255) DEFAULT NULL,
37
  "Habit" varchar(50) DEFAULT NULL,
38
  "TraitName" varchar(200) DEFAULT NULL,
39
  "TraitValue" varchar(100) DEFAULT NULL,
40
  "Unit" varchar(100) DEFAULT NULL,
41
  "Method" varchar(255) DEFAULT NULL,
42
  "Region" varchar(100) DEFAULT NULL,
43
  "Country" varchar(100) DEFAULT NULL,
44
  "StateProvince" varchar(100) DEFAULT NULL,
45
  "LowerPolitical" varchar(100) DEFAULT NULL,
46
  "LocalityDescription" varchar(100) DEFAULT NULL,
47
  "VerbatimLatitude" varchar(150) DEFAULT NULL,
48
  "VerbatimLongitude" varchar(150) DEFAULT NULL,
49
  "VerbatimElevation" varchar(150) DEFAULT NULL,
50
  "Source" varchar(100) DEFAULT NULL,
51
  "URLSource" varchar(100) DEFAULT NULL,
52
  "SourceCitation" varchar(1000) DEFAULT NULL,
53
  "SourceID" varchar(255) DEFAULT NULL,
54
  "VisitingDate" varchar(100) DEFAULT NULL,
55
  "ReferenceID" integer DEFAULT NULL,
56
  "Access" varchar(100) DEFAULT NULL,
57
  "Project_PI" varchar(255) DEFAULT NULL,
58
  "Project_PI_contact" varchar(100) DEFAULT NULL,
59
  "Observation" varchar(255) DEFAULT NULL,
60
  "Authorship" varchar(255) DEFAULT NULL,
61
  "AuthorshipContact" varchar(100) DEFAULT NULL,
62
  PRIMARY KEY ("TraitObservationID"),
63
  /*KEY "TaxonomyID" ("TaxonomyID")*/CHECK (true),
64
  /*KEY "Family" ("Family")*/CHECK (true),
65
  /*KEY "Taxon" ("Taxon")*/CHECK (true),
66
  /*KEY "TraitName" ("TraitName")*/CHECK (true),
67
  /*KEY "ReferenceID" ("ReferenceID")*/CHECK (true)
68
);
69
/*!40101 SET character_set_client = @saved_cs_client */;
70
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
71

  
72
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
73
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
74
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
75
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
76
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
77
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
78
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
79

  
80
-- Dump completed on 2012-12-17 12:45:51
inputs/TEAM/_archive/Vegetation-Metadata-1.4.pdf
1
link ci-team_extract/Vegetation-Metadata-1.4.pdf
2 0

  
inputs/TEAM/_src/Vegetation-Tree-and-Liana-Metadata-1.5.pdf
1
link TEAM-DataPackage-20120920191251_3859/Vegetation - Trees & Lianas/Vegetation-Tree-and-Liana-Metadata-1.5.pdf
2 0

  
inputs/TEAM/_src/TEAM-DataPackage-20120920191251_3859/README.txt
1
TEAM DataPackage
2
  
3
  A DataPackage is a zip file that contains all of the datasets selected to download in the
4
  Data Query and Download section of www.teamnetwork.org.  The TEAM DataPackage also contains important
5
  metadata documents that will help you to understand and use TEAM Protocol data.  When a TEAM DataPackage
6
  is unzipped directories will be created for each Protocol for which you have selected to download data. For example,
7
  if only Avian Protocol data was selected an "Avian" directory is created.  In this directory will be all the data files
8
  and the metadata file associated with the Avian dataset.  
9

  
10

  
11
File Naming Convention:
12
  
13
  Data Package
14
    Each DataPackage has a unique ID generated on the data and time it was created: yyyyMMddHHmmss-<4 digits id>
15
    Package name: TEAM-DataPackage-<package id>.zip
16
  
17
  Dataset    
18
    Each dataset downloaded will have the unique ID included in it's file name.  
19
    CSV file name For a  TEAM Protocol: <protocol abbrev>-<protocol version>-<package id>.csv  
20
    Tab delimited file name for a TEAM Protocol: <protocol abbrev>-<protocol version>-<package id>.tab
21
    
22
  Metadata
23
    Each TEAM Protocol data file will have an associated metadata document.
24
    Metdata file name: <Protocol Name>-Metadata-<version>.<subversion>.pdf
25

  
26

  
27
Protocol Abbreviations:
28
  
29
  AV for Avian
30
  BT for Butterfly
31
  CL for Climate
32
  VL for Liana
33
  LF for Litterfall
34
  PR for Primate
35
  VT for Tree
36

  
37
Important Information:
38

  
39
The TEAM Network Database is constantly being updated with new data as it comes in from TEAM Sites.  Data are also
40
constantly undergoing QA/QC (Quality Assurance and Quality Control) measures to ensure 
41
TEAM Network Data are of the highest scientific value.  Therefore it is important to check back frequently to ensure you
42
have the latest TEAM Data.  A "Dataset ID" is included in each TEAM Protocol dataset to easily track which version of data 
43
you have downloaded.  Please refer to the Data Use Policy printed in the first 62 lines of each dataset for questions
44
on the use or acknowledgement of TEAM Data.    
45

  
46

  
47

  
inputs/TEAM/_src/TEAM_Sites.csv
1
Site Name,Name,1ha Plot Coordinate,Longitude,Latitude,CollectionDate
2
Barro Colorado Nature Monument - Soberania National Park,VG-BCI-6,"0,0",-79.74438574165106,9.15660995990038,2012-03-22
3
Barro Colorado Nature Monument - Soberania National Park,VG-BCI-3,"0,0",-79.77443662472069,9.200405236333609,2012-03-23
4
Barro Colorado Nature Monument - Soberania National Park,VG-BCI-1,"0,0",-79.85346715897322,9.105386976152658,2012-04-09
5
Barro Colorado Nature Monument - Soberania National Park,VG-BCI-4,"0,0",-79.74066954106092,9.168865140527487,2012-03-28
6
Barro Colorado Nature Monument - Soberania National Park,VG-BCI-2,"0,0",-79.86121916212142,9.158292459324,2012-05-01
7
Barro Colorado Nature Monument - Soberania National Park,VG-BCI-5,"0,0",-79.71263433806598,9.146816963329911,2012-03-28
8
Bukit Barisan,VG-BBS-2,"0,0",104.40137917,-5.67447863,2010-09-30
9
Bukit Barisan,VG-BBS-3,"0,0",104.40137917,-5.61628793,2010-09-30
10
Bukit Barisan,VG-BBS-4,"0,0",104.4828133,-5.64433537,2010-09-30
11
Bukit Barisan,VG-BBS-5,"0,0",104.43636926,-5.62738457,2010-09-30
12
Bukit Barisan,VG-BBS-6,"0,0",104.49453531,-5.68786293,2010-09-30
13
Bukit Barisan,VG-BBS-1,"0,0",104.41399067,-5.64635684,2010-09-30
14
Bwindi Impenetrable Forest,VG-BIF-1,"0,0",29.6970333,-0.9132334,2009-11-23
15
Bwindi Impenetrable Forest,VG-BIF-2,"0,0",29.7260666,-0.8930833,2009-11-23
16
Bwindi Impenetrable Forest,VG-BIF-3,"0,0",29.7063833,-1.0125,2009-11-23
17
Bwindi Impenetrable Forest,VG-BIF-4,"0,0",29.6390166,-1.0246833,2009-11-23
18
Bwindi Impenetrable Forest,VG-BIF-5,"0,0",29.7606833,-1.0573,2009-11-23
19
Bwindi Impenetrable Forest,VG-BIF-6,"0,0",29.7177333,-1.0953,2009-11-23
20
Caxiuanã,VG-CAX-1,"0,0",-51.45916,-1.70781,2011-05-27
21
Caxiuanã,VG-CAX-6,"0,0",-51.4309,-1.72358,2011-05-27
22
Caxiuanã,VG-CAX-5,"0,0",-51.59084,-1.78128,2011-05-27
23
Caxiuanã,VG-CAX-4,"0,0",-51.52048,-1.75391,2011-05-27
24
Caxiuanã,VG-CAX-3,"0,0",-51.51098,-1.73408,2011-05-27
25
Caxiuanã,VG-CAX-2,"0,0",-51.48499,-1.72963,2011-05-27
26
Central Suriname Nature Reserve,VG-CSN-2,"0,0",-56.1860075,4.6969741,2011-01-11
27
Central Suriname Nature Reserve,VG-CSN-1,"0,0",-56.1877726,4.7380984,2011-01-11
28
Central Suriname Nature Reserve,VG-CSN-5,"0,0",-56.20514,4.8133699,2011-01-11
29
Central Suriname Nature Reserve,VG-CSN-3,"0,0",-56.1183967,4.8128766,2011-01-11
30
Cocha Cashu - Manu National Park,VG-COU-1,"0,0",-71.3978222,-11.8870005,2011-09-13
31
Cocha Cashu - Manu National Park,VG-COU-2,"0,0",-71.4249016,-11.8993577,2011-09-13
32
Cocha Cashu - Manu National Park,VG-COU-3,"0,0",-71.2813285,-11.9371996,2011-09-13
33
Cocha Cashu - Manu National Park,VG-COU-4,"0,0",-71.4024744,-11.904708,2011-09-13
34
Cocha Cashu - Manu National Park,VG-COU-5,"0,0",-71.4086283,-11.8784896,2011-09-13
35
Cocha Cashu - Manu National Park,VG-COU-6,"0,0",-71.2692159,-11.965529,2011-09-13
36
Korup National Park,VG-KRP-1,"0,0",8.85385,5.06505,2011-11-09
37
Korup National Park,VG-KRP-2,"0,0",8.86735,5.08098,2011-11-09
38
Korup National Park,VG-KRP-3,"0,0",8.84137,5.07968,2011-11-09
39
Korup National Park,VG-KRP-4,"0,0",8.83203,5.06102,2011-11-09
40
Korup National Park,VG-KRP-5,"0,0",8.8376,5.03708,2011-11-09
41
Korup National Park,VG-KRP-6,"0,0",8.85833,5.03741,2011-11-09
42
Manaus,VG-MAS-1,"0,0",-59.9468382,-2.9289898,2010-11-30
43
Manaus,VG-MAS-2,"0,0",-59.9053463,-2.9698361,2010-11-30
44
Manaus,VG-MAS-3,"0,0",-59.9015673,-2.4066878,2010-11-30
45
Manaus,VG-MAS-4,"0,0",-59.794235,-2.4313394,2010-11-30
46
Manaus,VG-MAS-5,"0,0",-60.2098673,-2.6185037,2010-11-30
47
Manaus,VG-MAS-6,"0,0",-60.1093966,-2.5975461,2010-11-30
48
Nam Kading,VG-NAK-1,"0,0",104.27965,18.2985,2010-03-09
49
Nam Kading,VG-NAK-2,"0,0",104.27967,18.2985,2010-03-24
50
Nam Kading,VG-NAK-3,"0,0",104.15525,18.39701,2009-12-09
51
Nam Kading,VG-NAK-4,"0,0",104.16643,18.36779,2009-11-10
52
Nam Kading,VG-NAK-5,"0,0",104.10685,18.43812,2010-02-13
53
Nam Kading,VG-NAK-6,"0,0",104.12318,18.40492,2010-01-10
54
Nouabalé Ndoki,VG-NNN-4,"0,0",16.4659089,2.4014756,2010-03-11
55
Nouabalé Ndoki,VG-NNN-5,"0,0",16.4283399,2.35894,2010-03-11
56
Nouabalé Ndoki,VG-NNN-6,"0,0",16.360348,2.3551752,2010-03-11
57
Nouabalé Ndoki,VG-NNN-1,"0,0",16.6207812,2.6572454,2010-03-11
58
Nouabalé Ndoki,VG-NNN-3,"0,0",16.5348413,2.614436,2010-03-11
59
Nouabalé Ndoki,VG-NNN-2,"0,0",16.5537878,2.6397392,2010-03-11
60
Pasoh Forest Reserve,VG-PSH-1,"0,0",102.18362,2.58797,--
61
Pasoh Forest Reserve,VG-PSH-2,"0,0",102.33218,3.05078,--
62
Pasoh Forest Reserve,VG-PSH-3,"0,0",102.33264,3.09845,--
63
Pasoh Forest Reserve,VG-PSH-4,"0,0",101.97991,3.11013,--
64
Pasoh Forest Reserve,VG-PSH-6,"0,0",101.97735,3.1628,--
65
Pasoh Forest Reserve,VG-PSH-5,"0,0",101.9806,3.19189,--
66
Ranomafana,VG-RNF-1,"0,0",47.5114,-21.12295,2010-12-29
67
Ranomafana,VG-RNF-2,"0,0",47.52052,-21.17866,2010-12-29
68
Ranomafana,VG-RNF-3,"0,0",47.410841,-21.21793,2010-12-29
69
Ranomafana,VG-RNF-4,"0,0",47.4533218,-21.2219612,2010-12-29
70
Ranomafana,VG-RNF-5,"0,0",47.40719,-21.30393,2010-12-29
71
Ranomafana,VG-RNF-6,"0,0",47.4457188,-21.3658431,2010-12-29
72
Udzungwa,VG-UDZ-1,"0,0",36.8860650460001,-7.71113257399998,2009-11-27
73
Udzungwa,VG-UDZ-2,"0,0",36.873368214,-7.69493397499997,2009-11-28
74
Udzungwa,VG-UDZ-3,"0,0",36.8956057340001,-7.77724184299996,2009-11-28
75
Udzungwa,VG-UDZ-4,"0,0",36.8707778880001,-7.75978012899998,2009-11-28
76
Udzungwa,VG-UDZ-5,"0,0",36.835541747,-7.83170386299997,2009-11-26
77
Udzungwa,VG-UDZ-6,"0,0",36.8632279890001,-7.83826772199996,2009-11-26
78
Volcán Barva,VG-VB-1,"0,0",-84.0200572927,10.41687655,2009-01-28
79
Volcán Barva,VG-VB-2,"0,0",-84.037524144,10.403171239,2008-06-05
80
Volcán Barva,VG-VB-3,"0,0",-84.0476422415,10.3160400918,2008-05-08
81
Volcán Barva,VG-VB-4,"0,0",-84.0572281091,10.3447163271,2008-05-30
82
Volcán Barva,VG-VB-5,"0,0",-84.1068322137,10.1823432219,2009-05-26
83
Volcán Barva,VG-VB-6,"0,0",-84.1080677857,10.1351986936,2009-05-25
84
Volcán Barva,VG-VB-7,"0,0",-84.0552816144,10.2678697806,2008-10-21
85
Volcán Barva,VG-VB-8,"0,0",-84.0850028149,10.2403425582,2009-11-13
86
Volcán Barva,VG-VB-9,"0,0",-84.00985772,10.43214216,2010-05-28
87
Yanachaga Chimillén National Park,VG-YAN-1,"0,0",-75.2503069,-10.35049162,--
88
Yanachaga Chimillén National Park,VG-YAN-2,"0,0",-75.25653021,-10.3806513,--
89
Yanachaga Chimillén National Park,VG-YAN-3,"0,0",-75.28502173,-10.35418209,--
90
Yanachaga Chimillén National Park,VG-YAN-4,"0,0",-75.29446998,-10.37508504,--
91
Yanachaga Chimillén National Park,VG-YAN-5,"0,0",-75.32989584,-10.40999508,--
92
Yanachaga Chimillén National Park,VG-YAN-6,"0,0",-75.31577971,-10.42219729,--
inputs/.NCBI/_src/readme.txt
1
link taxdmp/readme.txt
2 0

  
inputs/.NCBI/_src/taxdmp/readme.txt
1
*.dmp files are bcp-like dump from GenBank taxonomy database.
2

  
3
General information.
4
Field terminator is "\t|\t"
5
Row terminator is "\t|\n"
6

  
7
nodes.dmp file consists of taxonomy nodes. The description for each node includes the following
8
fields:
9
	tax_id					-- node id in GenBank taxonomy database
10
 	parent tax_id				-- parent node id in GenBank taxonomy database
11
 	rank					-- rank of this node (superkingdom, kingdom, ...) 
12
 	embl code				-- locus-name prefix; not unique
13
 	division id				-- see division.dmp file
14
 	inherited div flag  (1 or 0)		-- 1 if node inherits division from parent
15
 	genetic code id				-- see gencode.dmp file
16
 	inherited GC  flag  (1 or 0)		-- 1 if node inherits genetic code from parent
17
 	mitochondrial genetic code id		-- see gencode.dmp file
18
 	inherited MGC flag  (1 or 0)		-- 1 if node inherits mitochondrial gencode from parent
19
 	GenBank hidden flag (1 or 0)            -- 1 if name is suppressed in GenBank entry lineage
20
 	hidden subtree root flag (1 or 0)       -- 1 if this subtree has no sequence data yet
21
 	comments				-- free-text comments and citations
22

  
23
Taxonomy names file (names.dmp):
24
	tax_id					-- the id of node associated with this name
25
	name_txt				-- name itself
26
	unique name				-- the unique variant of this name if name not unique
27
	name class				-- (synonym, common name, ...)
28

  
29
Divisions file (division.dmp):
30
	division id				-- taxonomy database division id
31
	division cde				-- GenBank division code (three characters)
32
	division name				-- e.g. BCT, PLN, VRT, MAM, PRI...
33
	comments
34

  
35
Genetic codes file:
36
	genetic code id				-- GenBank genetic code id
37
	abbreviation				-- genetic code name abbreviation
38
	name					-- genetic code name
39
	cde					-- translation table for this genetic code
40
	starts					-- start codons for this genetic code
41

  
42
Deleted nodes file (delnodes.dmp):
43
	tax_id					-- deleted node id
44

  
45
Merged nodes file (merged.dmp):
46
	old_tax_id                              -- id of nodes which has been merged
47
	new_tax_id                              -- id of nodes which is result of merging
48

  
49
Citations file (citations.dmp):
50
	cit_id					-- the unique id of citation
51
	cit_key					-- citation key
52
	pubmed_id				-- unique id in PubMed database (0 if not in PubMed)
53
	medline_id				-- unique id in MedLine database (0 if not in MedLine)
54
	url					-- URL associated with citation
55
	text					-- any text (usually article name and authors).
56
						-- The following characters are escaped in this text by a backslash:
57
						-- newline (appear as "\n"),
58
						-- tab character ("\t"),
59
						-- double quotes ('\"'),
60
						-- backslash character ("\\").
61
	taxid_list				-- list of node ids separated by a single space
inputs/CTFS/_src/ERD.jpg
1
link STRI2011_DB v5.jpg
2 0

  
inputs/CTFS/_src/schema.sql
1
-- phpMyAdmin SQL Dump
2
-- version 3.4.6
3
-- http://www.phpmyadmin.net
4
--
5
-- Host: 127.0.0.1
6
-- Generation Time: Feb 24, 2012 at 02:12 PM
7
-- Server version: 5.5.16
8
-- PHP Version: 5.3.8
9

  
10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11
SET time_zone = "+00:00";
12

  
13

  
14
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17
/*!40101 SET NAMES utf8 */;
18

  
19
--
20
-- Database: `CTFS`
21
--
22

  
23
-- --------------------------------------------------------
24

  
25
--
26
-- Table structure for table `Census`
27
--
28

  
29
CREATE TABLE IF NOT EXISTS `Census` (
30
  `CensusID` int(10) unsigned NOT NULL AUTO_INCREMENT,
31
  `PlotID` int(10) unsigned NOT NULL,
32
  `PlotCensusNumber` int(11) DEFAULT NULL,
33
  `StartDate` date DEFAULT NULL,
34
  `EndDate` date DEFAULT NULL,
35
  `Description` varchar(128) DEFAULT NULL,
36
  PRIMARY KEY (`CensusID`),
37
  KEY `Ref610` (`PlotID`)
38
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=200 ;
39

  
40
-- --------------------------------------------------------
41

  
42
--
43
-- Table structure for table `CensusQuadrat`
44
--
45

  
46
CREATE TABLE IF NOT EXISTS `CensusQuadrat` (
47
  `CensusID` int(10) unsigned NOT NULL,
48
  `QuadratID` int(10) unsigned NOT NULL,
49
  `PlotID` int(10) unsigned NOT NULL,
50
  PRIMARY KEY (`CensusID`,`QuadratID`,`PlotID`),
51
  KEY `Ref733` (`QuadratID`,`PlotID`),
52
  KEY `Ref534` (`CensusID`)
53
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
54

  
55
-- --------------------------------------------------------
56

  
57
--
58
-- Table structure for table `Country`
59
--
60

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

  
67
-- --------------------------------------------------------
68

  
69
--
70
-- Table structure for table `CurrentObsolete`
71
--
72

  
73
CREATE TABLE IF NOT EXISTS `CurrentObsolete` (
74
  `SpeciesID` int(10) unsigned NOT NULL,
75
  `ObsoleteSpeciesID` int(10) unsigned NOT NULL,
76
  `ChangeDate` datetime NOT NULL,
77
  `ChangeCodeID` int(10) unsigned NOT NULL,
78
  `ChangeNote` varchar(128) DEFAULT NULL,
79
  PRIMARY KEY (`SpeciesID`,`ObsoleteSpeciesID`,`ChangeDate`),
80
  KEY `Ref32191` (`ChangeCodeID`),
81
  KEY `Ref92192` (`SpeciesID`),
82
  KEY `Ref92212` (`ObsoleteSpeciesID`)
83
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
84

  
85
-- --------------------------------------------------------
86

  
87
--
88
-- Table structure for table `DataCollection`
89
--
90

  
91
CREATE TABLE IF NOT EXISTS `DataCollection` (
92
  `PersonnelID` smallint(5) unsigned NOT NULL,
93
  `RoleID` smallint(5) unsigned NOT NULL,
94
  `CensusID` int(10) unsigned NOT NULL,
95
  `QuadratID` int(10) unsigned NOT NULL,
96
  `PlotID` int(10) unsigned NOT NULL,
97
  `StartDate` date DEFAULT NULL,
98
  `EndDate` date DEFAULT NULL,
99
  PRIMARY KEY (`PersonnelID`,`RoleID`,`CensusID`,`QuadratID`,`PlotID`),
100
  KEY `Ref3883` (`RoleID`),
101
  KEY `Ref1743` (`CensusID`,`QuadratID`,`PlotID`),
102
  KEY `Ref1544` (`PersonnelID`)
103
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
104

  
105
-- --------------------------------------------------------
106

  
107
--
108
-- Table structure for table `DataEntry`
109
--
110

  
111
CREATE TABLE IF NOT EXISTS `DataEntry` (
112
  `PersonnelID` smallint(5) unsigned NOT NULL,
113
  `CensusID` int(10) unsigned NOT NULL,
114
  `QuadratID` int(10) unsigned NOT NULL,
115
  `PlotID` int(10) unsigned NOT NULL,
116
  `StartDate` date DEFAULT NULL,
117
  `EndDate` date DEFAULT NULL,
118
  PRIMARY KEY (`PersonnelID`,`CensusID`,`QuadratID`,`PlotID`),
119
  KEY `Ref1745` (`CensusID`,`QuadratID`,`PlotID`),
120
  KEY `Ref1547` (`PersonnelID`)
121
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
122

  
123
-- --------------------------------------------------------
124

  
125
--
126
-- Table structure for table `DFtemp`
127
--
128

  
129
CREATE TABLE IF NOT EXISTS `DFtemp` (
130
  `MeasureID` int(11) NOT NULL,
131
  `PlotID` int(11) NOT NULL,
132
  `Plot` varchar(35) DEFAULT NULL,
133
  `Family` char(32) DEFAULT NULL,
134
  `GenusSpecies` char(64) DEFAULT NULL,
135
  `Genus` char(32) DEFAULT NULL,
136
  `SpeciesName` char(64) DEFAULT NULL,
137
  `SpeciesID` int(10) unsigned DEFAULT NULL,
138
  `Mnemonic` char(10) DEFAULT NULL,
139
  `QuadratID` int(11) NOT NULL,
140
  `QuadratName` varchar(12) DEFAULT NULL,
141
  `x` float DEFAULT NULL,
142
  `y` float DEFAULT NULL,
143
  `gx` float DEFAULT NULL,
144
  `gy` float DEFAULT NULL,
145
  `TreeID` int(11) NOT NULL,
146
  `Tag` char(10) DEFAULT NULL,
147
  `StemID` int(11) NOT NULL,
148
  `StemTag` varchar(32) DEFAULT NULL,
149
  `PrimaryStem` char(20) DEFAULT NULL,
150
  `CensusID` int(11) NOT NULL,
151
  `PlotCensusNumber` int(11) DEFAULT NULL,
152
  `DBH` float DEFAULT NULL,
153
  `HOM` float DEFAULT NULL,
154
  `ExactDate` date DEFAULT NULL,
155
  `ListOfTSM` varchar(256) DEFAULT NULL,
156
  `Status` varchar(15) DEFAULT NULL,
157
  PRIMARY KEY (`MeasureID`,`CensusID`),
158
  KEY `PlotID` (`PlotID`),
159
  KEY `Genus` (`Genus`(5)),
160
  KEY `SpeciesName` (`SpeciesName`(5)),
161
  KEY `SpeciesID` (`SpeciesID`),
162
  KEY `QuadratName` (`QuadratName`(4)),
163
  KEY `PlotCensusNumber` (`PlotCensusNumber`),
164
  KEY `DBH` (`DBH`),
165
  KEY `PrimaryStem` (`PrimaryStem`),
166
  KEY `ListOfTSM` (`ListOfTSM`),
167
  KEY `Status` (`Status`),
168
  KEY `ForDataEntry` (`TreeID`,`StemID`,`CensusID`),
169
  KEY `ForDataScreening` (`Tag`,`StemTag`,`PlotID`)
170
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
171

  
172
-- --------------------------------------------------------
173

  
174
--
175
-- Table structure for table `Family`
176
--
177

  
178
CREATE TABLE IF NOT EXISTS `Family` (
179
  `FamilyID` int(10) unsigned NOT NULL AUTO_INCREMENT,
180
  `Family` char(32) DEFAULT NULL,
181
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
182
  PRIMARY KEY (`FamilyID`),
183
  KEY `Ref84175` (`ReferenceID`)
184
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=550 ;
185

  
186
-- --------------------------------------------------------
187

  
188
--
189
-- Table structure for table `Genus`
190
--
191

  
192
CREATE TABLE IF NOT EXISTS `Genus` (
193
  `GenusID` int(10) unsigned NOT NULL AUTO_INCREMENT,
194
  `Genus` char(32) DEFAULT NULL,
195
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
196
  `Authority` char(32) DEFAULT NULL,
197
  `FamilyID` int(10) unsigned NOT NULL,
198
  PRIMARY KEY (`GenusID`),
199
  KEY `Ref2868` (`FamilyID`),
200
  KEY `Ref84176` (`ReferenceID`)
201
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21244 ;
202

  
203
-- --------------------------------------------------------
204

  
205
--
206
-- Table structure for table `LogMAttrHistory`
207
--
208

  
209
CREATE TABLE IF NOT EXISTS `LogMAttrHistory` (
210
  `LogMAttrHistoryID` int(10) unsigned NOT NULL AUTO_INCREMENT,
211
  `MeasureID` int(10) unsigned NOT NULL,
212
  `CensusID` int(10) unsigned NOT NULL,
213
  `TSMID` int(10) unsigned NOT NULL,
214
  `DateOfChange` date DEFAULT NULL,
215
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
216
  PRIMARY KEY (`LogMAttrHistoryID`),
217
  KEY `Ref21225` (`MeasureID`,`CensusID`,`TSMID`)
218
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13754 ;
219

  
220
-- --------------------------------------------------------
221

  
222
--
223
-- Table structure for table `LogMAttrHistoryd`
224
--
225

  
226
CREATE TABLE IF NOT EXISTS `LogMAttrHistoryd` (
227
  `LogMAttrHistoryID` int(10) unsigned NOT NULL AUTO_INCREMENT,
228
  `MeasureID` int(10) unsigned NOT NULL,
229
  `CensusID` int(10) unsigned NOT NULL,
230
  `TSMID` int(10) unsigned NOT NULL,
231
  `DateOfChange` date DEFAULT NULL,
232
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
233
  PRIMARY KEY (`LogMAttrHistoryID`),
234
  KEY `Ref21225` (`MeasureID`,`CensusID`,`TSMID`)
235
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
236

  
237
-- --------------------------------------------------------
238

  
239
--
240
-- Table structure for table `LogMeasurementHistory`
241
--
242

  
243
CREATE TABLE IF NOT EXISTS `LogMeasurementHistory` (
244
  `MeasureID` int(10) unsigned NOT NULL,
245
  `CensusID` int(10) unsigned NOT NULL,
246
  `MeasurementHistoryID` int(10) unsigned NOT NULL,
247
  `StemID` int(10) unsigned DEFAULT NULL,
248
  `TreeID` int(10) unsigned DEFAULT NULL,
249
  `DateOfChange` date NOT NULL,
250
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
251
  `DBH` float DEFAULT NULL,
252
  `HOM` float DEFAULT NULL,
253
  `ExactDate` date DEFAULT NULL,
254
  PRIMARY KEY (`MeasureID`,`CensusID`,`MeasurementHistoryID`),
255
  KEY `Ref287` (`MeasureID`,`CensusID`)
256
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
257

  
258
-- --------------------------------------------------------
259

  
260
--
261
-- Table structure for table `LogMeasurementHistoryd`
262
--
263

  
264
CREATE TABLE IF NOT EXISTS `LogMeasurementHistoryd` (
265
  `MeasureID` int(10) unsigned NOT NULL,
266
  `CensusID` int(10) unsigned NOT NULL,
267
  `MeasurementHistoryID` int(10) unsigned NOT NULL,
268
  `StemID` int(10) unsigned DEFAULT NULL,
269
  `TreeID` int(10) unsigned DEFAULT NULL,
270
  `DateOfChange` date NOT NULL,
271
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
272
  `DBH` float DEFAULT NULL,
273
  `HOM` float DEFAULT NULL,
274
  `ExactDate` date DEFAULT NULL,
275
  PRIMARY KEY (`MeasureID`,`CensusID`,`MeasurementHistoryID`),
276
  KEY `Ref287` (`MeasureID`,`CensusID`)
277
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
278

  
279
-- --------------------------------------------------------
280

  
281
--
282
-- Table structure for table `LogSpeciesInventory`
283
--
284

  
285
CREATE TABLE IF NOT EXISTS `LogSpeciesInventory` (
286
  `SpeciesInvHistID` int(10) unsigned NOT NULL AUTO_INCREMENT,
287
  `SpeciesInvID` int(10) unsigned NOT NULL,
288
  `CensusID` int(10) unsigned NOT NULL,
289
  `PlotID` int(10) unsigned NOT NULL,
290
  `SpeciesID` int(10) unsigned NOT NULL,
291
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
292
  `DateOfChange` date DEFAULT NULL,
293
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
294
  PRIMARY KEY (`SpeciesInvHistID`)
295
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=47 ;
296

  
297
-- --------------------------------------------------------
298

  
299
--
300
-- Table structure for table `LogTreeAttrHistory`
301
--
302

  
303
CREATE TABLE IF NOT EXISTS `LogTreeAttrHistory` (
304
  `LogTAttrHistoryID` int(10) unsigned NOT NULL AUTO_INCREMENT,
305
  `CensusID` int(10) unsigned NOT NULL,
306
  `TreeID` int(10) unsigned NOT NULL,
307
  `TSMID` int(10) unsigned NOT NULL,
308
  `DateOfChange` date DEFAULT NULL,
309
  `DescriptionOfChange` varchar(128) DEFAULT NULL,
310
  PRIMARY KEY (`LogTAttrHistoryID`),
311
  KEY `Ref24226` (`CensusID`,`TreeID`,`TSMID`)
312
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
313

  
314
-- --------------------------------------------------------
315

  
316
--
317
-- Table structure for table `LogTreeHistory`
318
--
319

  
320
CREATE TABLE IF NOT EXISTS `LogTreeHistory` (
321
  `TreeID` int(10) unsigned NOT NULL,
322
  `TreeHistoryID` int(10) unsigned NOT NULL,
323
  `ChangeCodeID` int(10) unsigned DEFAULT NULL,
324
  `ChangeDate` date DEFAULT NULL,
325
  `ChangeDescription` varchar(128) DEFAULT NULL,
326
  `QuadratID` int(10) unsigned DEFAULT NULL,
327
  `PlotID` int(10) unsigned DEFAULT NULL,
328
  `Tag` char(10) DEFAULT NULL,
329
  `X` float DEFAULT NULL,
330
  `Y` float DEFAULT NULL,
331
  `SpeciesID` int(10) unsigned DEFAULT NULL,
332
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
333
  PRIMARY KEY (`TreeID`,`TreeHistoryID`),
334
  KEY `Ref186` (`TreeID`),
335
  KEY `Ref32221` (`ChangeCodeID`)
336
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
337

  
338
-- --------------------------------------------------------
339

  
340
--
341
-- Table structure for table `LogTreeHistoryd`
342
--
343

  
344
CREATE TABLE IF NOT EXISTS `LogTreeHistoryd` (
345
  `TreeID` int(10) unsigned NOT NULL,
346
  `TreeHistoryID` int(10) unsigned NOT NULL,
347
  `ChangeCodeID` int(10) unsigned DEFAULT NULL,
348
  `ChangeDate` date DEFAULT NULL,
349
  `ChangeDescription` varchar(128) DEFAULT NULL,
350
  `QuadratID` int(10) unsigned DEFAULT NULL,
351
  `PlotID` int(10) unsigned DEFAULT NULL,
352
  `Tag` char(10) DEFAULT NULL,
353
  `X` float DEFAULT NULL,
354
  `Y` float DEFAULT NULL,
355
  `SpeciesID` int(10) unsigned DEFAULT NULL,
356
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
357
  PRIMARY KEY (`TreeID`,`TreeHistoryID`),
358
  KEY `Ref186` (`TreeID`),
359
  KEY `Ref32221` (`ChangeCodeID`)
360
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
361

  
362
-- --------------------------------------------------------
363

  
364
--
365
-- Table structure for table `Measurement`
366
--
367

  
368
CREATE TABLE IF NOT EXISTS `Measurement` (
369
  `MeasureID` int(10) unsigned NOT NULL,
370
  `CensusID` int(10) unsigned NOT NULL,
371
  `StemID` int(10) unsigned NOT NULL,
372
  `TreeID` int(10) unsigned NOT NULL,
373
  `DBH` float DEFAULT NULL,
374
  `HOM` float DEFAULT NULL,
375
  `PrimaryStem` varchar(20) DEFAULT NULL,
376
  `ExactDate` date DEFAULT NULL,
377
  PRIMARY KEY (`MeasureID`,`CensusID`),
378
  KEY `Ref549` (`CensusID`),
379
  KEY `Ref1951` (`StemID`,`TreeID`),
380
  KEY `TreeID` (`TreeID`)
381
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
382

  
383
-- --------------------------------------------------------
384

  
385
--
386
-- Table structure for table `MeasurementAttributes`
387
--
388

  
389
CREATE TABLE IF NOT EXISTS `MeasurementAttributes` (
390
  `MeasureID` int(10) unsigned NOT NULL,
391
  `CensusID` int(10) unsigned NOT NULL,
392
  `TSMID` int(10) unsigned NOT NULL,
393
  PRIMARY KEY (`MeasureID`,`CensusID`,`TSMID`),
394
  KEY `Ref252` (`MeasureID`,`CensusID`),
395
  KEY `Ref2053` (`TSMID`)
396
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
397

  
398
-- --------------------------------------------------------
399

  
400
--
401
-- Table structure for table `Personnel`
402
--
403

  
404
CREATE TABLE IF NOT EXISTS `Personnel` (
405
  `PersonnelID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
406
  `FirstName` varchar(32) DEFAULT NULL,
407
  `LastName` varchar(32) NOT NULL,
408
  PRIMARY KEY (`PersonnelID`)
409
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=95 ;
410

  
411
-- --------------------------------------------------------
412

  
413
--
414
-- Table structure for table `Quadrat`
415
--
416

  
417
CREATE TABLE IF NOT EXISTS `Quadrat` (
418
  `QuadratID` int(10) unsigned NOT NULL,
419
  `PlotID` int(10) unsigned NOT NULL,
420
  `QuadratName` char(8) DEFAULT NULL,
421
  `StartX` float DEFAULT NULL,
422
  `StartY` float DEFAULT NULL,
423
  `DimX` float DEFAULT NULL,
424
  `DimY` float DEFAULT NULL,
425
  PRIMARY KEY (`QuadratID`,`PlotID`),
426
  KEY `Ref69` (`PlotID`),
427
  KEY `QuadratName` (`QuadratName`,`PlotID`)
428
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
429

  
430
-- --------------------------------------------------------
431

  
432
--
433
-- Table structure for table `Reference`
434
--
435

  
436
CREATE TABLE IF NOT EXISTS `Reference` (
437
  `ReferenceID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
438
  `PublicationTitle` varchar(64) DEFAULT NULL,
439
  `FullReference` varchar(256) DEFAULT NULL,
440
  `DateofPublication` date DEFAULT NULL,
441
  PRIMARY KEY (`ReferenceID`)
442
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
443

  
444
-- --------------------------------------------------------
445

  
446
--
447
-- Table structure for table `RemeasAttribs`
448
--
449

  
450
CREATE TABLE IF NOT EXISTS `RemeasAttribs` (
451
  `RemeasureID` int(10) unsigned NOT NULL,
452
  `CensusID` int(10) unsigned NOT NULL,
453
  `TSMID` int(10) unsigned NOT NULL,
454
  PRIMARY KEY (`RemeasureID`,`CensusID`,`TSMID`),
455
  KEY `Ref2073` (`TSMID`),
456
  KEY `Ref2274` (`RemeasureID`,`CensusID`)
457
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
458

  
459
-- --------------------------------------------------------
460

  
461
--
462
-- Table structure for table `Remeasurement`
463
--
464

  
465
CREATE TABLE IF NOT EXISTS `Remeasurement` (
466
  `RemeasureID` int(10) unsigned NOT NULL,
467
  `CensusID` int(10) unsigned NOT NULL,
468
  `StemID` int(10) unsigned NOT NULL,
469
  `TreeID` int(10) unsigned NOT NULL,
470
  `DBH` float DEFAULT NULL,
471
  `HOM` float DEFAULT NULL,
472
  `ExactDate` date DEFAULT NULL,
473
  PRIMARY KEY (`RemeasureID`,`CensusID`),
474
  KEY `Ref1957` (`StemID`,`TreeID`),
475
  KEY `Ref5106` (`CensusID`),
476
  KEY `RefTree57` (`TreeID`)
477
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
478

  
479
-- --------------------------------------------------------
480

  
481
--
482
-- Table structure for table `ReviewChange`
483
--
484

  
485
CREATE TABLE IF NOT EXISTS `ReviewChange` (
486
  `RID` int(4) unsigned NOT NULL,
487
  `TreeID` int(10) unsigned NOT NULL,
488
  `QuadratID` int(10) unsigned NOT NULL,
489
  `PlotID` int(10) unsigned NOT NULL,
490
  `FmSpeciesID` int(10) unsigned NOT NULL,
491
  `ToSpeciesID` int(10) unsigned NOT NULL,
492
  `ChangeCodeID` int(10) unsigned NOT NULL,
493
  `Tag` char(10) DEFAULT NULL,
494
  PRIMARY KEY (`RID`)
495
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
496

  
497
-- --------------------------------------------------------
498

  
499
--
500
-- Table structure for table `ReviewNewSpecies`
501
--
502

  
503
CREATE TABLE IF NOT EXISTS `ReviewNewSpecies` (
504
  `SpeciesID` int(10) unsigned NOT NULL,
505
  `genusID` int(10) unsigned NOT NULL,
506
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
507
  `FullSpeciesName` char(128) DEFAULT NULL,
508
  `Authority` varchar(128) DEFAULT NULL,
509
  `IDLevel` char(8) DEFAULT NULL,
510
  `FieldFamily` char(32) DEFAULT NULL,
511
  `Description` varchar(128) DEFAULT NULL,
512
  `PublicationTitle` varchar(128) DEFAULT NULL,
513
  `FullReference` varchar(256) DEFAULT NULL,
514
  `DateOfPublication` date DEFAULT NULL,
515
  PRIMARY KEY (`SpeciesID`)
516
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
517

  
518
-- --------------------------------------------------------
519

  
520
--
521
-- Table structure for table `RoleReference`
522
--
523

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

  
530
-- --------------------------------------------------------
531

  
532
--
533
-- Table structure for table `Site`
534
--
535

  
536
CREATE TABLE IF NOT EXISTS `Site` (
537
  `PlotID` int(10) unsigned NOT NULL AUTO_INCREMENT,
538
  `PlotName` char(64) DEFAULT NULL,
539
  `LocationName` varchar(128) DEFAULT NULL,
540
  `CountryID` smallint(5) unsigned NOT NULL,
541
  `Latitude` float DEFAULT NULL,
542
  `Longitude` float DEFAULT NULL,
543
  `Elevation` float DEFAULT NULL,
544
  `ReferenceX` float DEFAULT NULL,
545
  `ReferenceY` float DEFAULT NULL,
546
  `SizeOfSite` char(32) DEFAULT NULL,
547
  `ShapeOfSite` char(32) DEFAULT NULL,
548
  `DescriptionOfSite` varchar(128) DEFAULT NULL,
549
  PRIMARY KEY (`PlotID`),
550
  KEY `Ref87173` (`CountryID`)
551
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=158 ;
552

  
553
-- --------------------------------------------------------
554

  
555
--
556
-- Table structure for table `Species`
557
--
558

  
559
CREATE TABLE IF NOT EXISTS `Species` (
560
  `SpeciesID` int(10) unsigned NOT NULL AUTO_INCREMENT,
561
  `CurrentTaxonFlag` smallint(6) DEFAULT NULL,
562
  `ObsoleteTaxonFlag` smallint(6) DEFAULT NULL,
563
  `GenusID` int(10) unsigned NOT NULL,
564
  `ReferenceID` smallint(5) unsigned DEFAULT NULL,
565
  `SpeciesName` char(64) DEFAULT NULL,
566
  `Mnemonic` char(10) DEFAULT NULL,
567
  `Authority` varchar(128) DEFAULT NULL,
568
  `IDLevel` char(8) DEFAULT NULL,
569
  `FieldFamily` char(32) DEFAULT NULL,
570
  `Description` varchar(128) DEFAULT NULL,
571
  PRIMARY KEY (`SpeciesID`),
572
  KEY `Ref26208` (`GenusID`),
573
  KEY `Ref84209` (`ReferenceID`),
574
  KEY `Mnemonic` (`Mnemonic`)
575
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1473 ;
576

  
577
-- --------------------------------------------------------
578

  
579
--
580
-- Table structure for table `SpeciesInventory`
581
--
582

  
583
CREATE TABLE IF NOT EXISTS `SpeciesInventory` (
584
  `SpeciesInvID` int(10) unsigned NOT NULL AUTO_INCREMENT,
585
  `CensusID` int(10) unsigned NOT NULL,
586
  `PlotID` int(10) unsigned NOT NULL,
587
  `SpeciesID` int(10) unsigned NOT NULL,
588
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
589
  PRIMARY KEY (`SpeciesInvID`),
590
  KEY `Ref92198` (`SpeciesID`),
591
  KEY `Ref93199` (`SubSpeciesID`),
592
  KEY `Ref5222` (`CensusID`),
593
  KEY `Ref642` (`PlotID`)
594
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10226 ;
595

  
596
-- --------------------------------------------------------
597

  
598
--
599
-- Table structure for table `Specimen`
600
--
601

  
602
CREATE TABLE IF NOT EXISTS `Specimen` (
603
  `SpecimenID` int(10) unsigned NOT NULL AUTO_INCREMENT,
604
  `TreeID` int(10) unsigned NOT NULL,
605
  `Collector` char(64) DEFAULT NULL,
606
  `SpecimenNumber` int(10) unsigned DEFAULT NULL,
607
  `SpeciesID` int(10) unsigned NOT NULL,
608
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
609
  `Herbarium` char(32) DEFAULT NULL,
610
  `Voucher` smallint(5) unsigned DEFAULT NULL,
611
  `CollectionDate` date DEFAULT NULL,
612
  `DeterminedBy` char(64) DEFAULT NULL,
613
  `Description` varchar(128) DEFAULT NULL,
614
  PRIMARY KEY (`SpecimenID`),
615
  KEY `Ref93194` (`SubSpeciesID`),
616
  KEY `Ref92196` (`SpeciesID`),
617
  KEY `Ref1171` (`TreeID`)
618
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
619

  
620
-- --------------------------------------------------------
621

  
622
--
623
-- Table structure for table `SqlLog`
624
--
625

  
626
CREATE TABLE IF NOT EXISTS `SqlLog` (
627
  `SqlID` int(4) NOT NULL DEFAULT '0',
628
  `ToTableName` varchar(23) DEFAULT NULL,
629
  `SqlStmt` varchar(16384) DEFAULT NULL,
630
  PRIMARY KEY (`SqlID`)
631
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
632

  
633
-- --------------------------------------------------------
634

  
635
--
636
-- Table structure for table `StageSource`
637
--
638

  
639
CREATE TABLE IF NOT EXISTS `StageSource` (
640
  `ChangeID` int(10) unsigned NOT NULL,
641
  `SourceNo` int(10) unsigned NOT NULL,
642
  `SpeciesID` int(10) unsigned NOT NULL,
643
  PRIMARY KEY (`ChangeID`,`SourceNo`),
644
  KEY `Ref96202` (`ChangeID`),
645
  KEY `Ref92214` (`SpeciesID`)
646
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
647

  
648
-- --------------------------------------------------------
649

  
650
--
651
-- Table structure for table `StageTarget`
652
--
653

  
654
CREATE TABLE IF NOT EXISTS `StageTarget` (
655
  `ChangeID` int(10) unsigned NOT NULL,
656
  `TargetNo` int(10) unsigned NOT NULL,
657
  `SpeciesID` int(10) unsigned NOT NULL,
658
  PRIMARY KEY (`ChangeID`,`TargetNo`),
659
  KEY `Ref96203` (`ChangeID`),
660
  KEY `Ref92215` (`SpeciesID`)
661
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
662

  
663
-- --------------------------------------------------------
664

  
665
--
666
-- Table structure for table `StageTargetNew`
667
--
668

  
669
CREATE TABLE IF NOT EXISTS `StageTargetNew` (
670
  `ChangeID` int(10) unsigned NOT NULL,
671
  `TargetNo` int(10) unsigned NOT NULL,
672
  `SpeciesID` int(10) unsigned NOT NULL,
673
  `CurrentTaxonFlag` smallint(6) DEFAULT NULL,
674
  `ObsoleteTaxonFlag` smallint(6) DEFAULT NULL,
675
  `GenusID` int(10) unsigned NOT NULL,
676
  `ReferenceID` smallint(5) unsigned NOT NULL,
677
  `SpeciesName` char(64) DEFAULT NULL,
678
  `Mnemonic` char(10) DEFAULT NULL,
679
  `Authority` varchar(128) DEFAULT NULL,
680
  `IDLevel` char(8) DEFAULT NULL,
681
  `FieldFamily` char(32) DEFAULT NULL,
682
  `Description` char(64) DEFAULT NULL,
683
  PRIMARY KEY (`ChangeID`,`TargetNo`),
684
  KEY `Ref96223` (`ChangeID`)
685
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
686

  
687
-- --------------------------------------------------------
688

  
689
--
690
-- Table structure for table `StageTaxonomicChanges`
691
--
692

  
693
CREATE TABLE IF NOT EXISTS `StageTaxonomicChanges` (
694
  `ChangeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
695
  `ChangeCodeID` int(10) unsigned NOT NULL,
696
  `PersonnelID` smallint(5) unsigned NOT NULL,
697
  `ChangeDate` date DEFAULT NULL,
698
  `NumberOfSource` int(10) unsigned DEFAULT NULL,
699
  `NumberOfTarget` int(10) unsigned DEFAULT NULL,
700
  `NumberOfTargetNew` int(10) unsigned DEFAULT NULL,
701
  PRIMARY KEY (`ChangeID`),
702
  KEY `Ref32216` (`ChangeCodeID`),
703
  KEY `Ref15224` (`PersonnelID`)
704
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
705

  
706
-- --------------------------------------------------------
707

  
708
--
709
-- Table structure for table `Stem`
710
--
711

  
712
CREATE TABLE IF NOT EXISTS `Stem` (
713
  `StemID` int(10) unsigned NOT NULL,
714
  `TreeID` int(10) unsigned NOT NULL,
715
  `StemTag` varchar(32) DEFAULT NULL,
716
  `StemDescription` varchar(128) DEFAULT NULL,
717
  PRIMARY KEY (`StemID`,`TreeID`),
718
  KEY `Ref150` (`TreeID`)
719
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
720

  
721
-- --------------------------------------------------------
722

  
723
--
724
-- Table structure for table `SubSpecies`
725
--
726

  
727
CREATE TABLE IF NOT EXISTS `SubSpecies` (
728
  `SubSpeciesID` int(10) unsigned NOT NULL AUTO_INCREMENT,
729
  `SpeciesID` int(10) unsigned NOT NULL,
730
  `CurrentTaxonFlag` smallint(6) DEFAULT NULL,
731
  `ObsoleteTaxonFlag` smallint(6) DEFAULT NULL,
732
  `SubSpeciesName` char(64) DEFAULT NULL,
733
  `Mnemonic` char(10) DEFAULT NULL,
734
  `Authority` varchar(128) DEFAULT NULL,
735
  `InfraSpecificLevel` char(32) DEFAULT NULL,
736
  PRIMARY KEY (`SubSpeciesID`),
737
  KEY `Ref92193` (`SpeciesID`)
738
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
739

  
740
-- --------------------------------------------------------
741

  
742
--
743
-- Table structure for table `TAX1temp`
744
--
745

  
746
CREATE TABLE IF NOT EXISTS `TAX1temp` (
747
  `SpeciesID` int(11) NOT NULL,
748
  `SubspeciesID` int(11) NOT NULL DEFAULT '0',
749
  `Family` char(32) DEFAULT NULL,
750
  `Genus` char(32) DEFAULT NULL,
751
  `Mnemonic` char(10) DEFAULT NULL,
752
  `SpeciesName` char(64) DEFAULT NULL,
753
  `SubspeciesName` char(64) DEFAULT NULL,
754
  `IDLevel` char(8) DEFAULT NULL,
755
  `Authority` char(124) DEFAULT NULL,
756
  `ListOfOldNames` varchar(255) DEFAULT NULL,
757
  `NumberOfHerbarium` int(11) DEFAULT NULL,
758
  `ListOfHerbarium` varchar(255) DEFAULT NULL,
759
  `Description` varchar(128) DEFAULT NULL,
760
  PRIMARY KEY (`SpeciesID`,`SubspeciesID`)
761
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
762

  
763
-- --------------------------------------------------------
764

  
765
--
766
-- Table structure for table `TAX2temp`
767
--
768

  
769
CREATE TABLE IF NOT EXISTS `TAX2temp` (
770
  `SpeciesID` int(11) NOT NULL,
771
  `ObsoleteSpeciesID` int(11) NOT NULL,
772
  `ObsoleteGenusName` char(32) DEFAULT NULL,
773
  `ObsoleteSpeciesName` char(64) DEFAULT NULL,
774
  `ObsoleteGenSpeName` char(128) DEFAULT NULL,
775
  `Description` char(128) DEFAULT NULL,
776
  `ChangeDate` date NOT NULL DEFAULT '0000-00-00',
777
  `Family` char(32) DEFAULT NULL,
778
  `Genus` char(32) DEFAULT NULL,
779
  `SpeciesName` char(64) DEFAULT NULL,
780
  `Authority` char(128) DEFAULT NULL,
781
  `IDLevel` char(8) DEFAULT NULL,
782
  PRIMARY KEY (`SpeciesID`,`ObsoleteSpeciesID`,`ChangeDate`)
783
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
784

  
785
-- --------------------------------------------------------
786

  
787
--
788
-- Table structure for table `TAX3temp`
789
--
790

  
791
CREATE TABLE IF NOT EXISTS `TAX3temp` (
792
  `PlotSpeciesID` int(11) NOT NULL AUTO_INCREMENT,
793
  `PlotID` int(11) NOT NULL,
794
  `SpeciesID` int(11) NOT NULL,
795
  `SubSpeciesID` int(11) DEFAULT NULL,
796
  PRIMARY KEY (`PlotSpeciesID`),
797
  KEY `TAX3Plot` (`PlotID`,`SpeciesID`,`SubSpeciesID`)
798
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17167 ;
799

  
800
-- --------------------------------------------------------
801

  
802
--
803
-- Table structure for table `Tree`
804
--
805

  
806
CREATE TABLE IF NOT EXISTS `Tree` (
807
  `TreeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
808
  `QuadratID` int(10) unsigned NOT NULL,
809
  `PlotID` int(10) unsigned NOT NULL,
810
  `Tag` char(10) DEFAULT NULL,
811
  `x` float DEFAULT NULL,
812
  `y` float DEFAULT NULL,
813
  `SpeciesID` int(10) unsigned NOT NULL,
814
  `SubSpeciesID` int(10) unsigned DEFAULT NULL,
815
  PRIMARY KEY (`TreeID`),
816
  KEY `Ref92217` (`SpeciesID`),
817
  KEY `Ref93219` (`SubSpeciesID`),
818
  KEY `Ref735` (`QuadratID`,`PlotID`),
819
  KEY `Tag` (`Tag`,`PlotID`)
820
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=482149 ;
821

  
822
-- --------------------------------------------------------
823

  
824
--
825
-- Table structure for table `TreeAttributes`
826
--
827

  
828
CREATE TABLE IF NOT EXISTS `TreeAttributes` (
829
  `CensusID` int(10) unsigned NOT NULL,
830
  `TreeID` int(10) unsigned NOT NULL,
831
  `TSMID` int(10) unsigned NOT NULL,
832
  PRIMARY KEY (`CensusID`,`TreeID`,`TSMID`),
833
  KEY `Ref163` (`TreeID`),
834
  KEY `Ref2064` (`TSMID`),
835
  KEY `Ref5107` (`CensusID`)
836
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
837

  
838
-- --------------------------------------------------------
839

  
840
--
841
-- Table structure for table `TreeTaxChange`
842
--
843

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

  
850
-- --------------------------------------------------------
851

  
852
--
853
-- Table structure for table `TSMAttributes`
854
--
855

  
856
CREATE TABLE IF NOT EXISTS `TSMAttributes` (
857
  `TSMID` int(10) unsigned NOT NULL AUTO_INCREMENT,
858
  `TSMCode` char(10) NOT NULL,
859
  `Description` varchar(128) NOT NULL,
860
  PRIMARY KEY (`TSMID`)
861
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=60 ;
862

  
863
--
864
-- Constraints for dumped tables
865
--
866

  
867
--
868
-- Constraints for table `Census`
869
--
870
ALTER TABLE `Census`
871
  ADD CONSTRAINT `Census_ibfk_1` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`),
872
  ADD CONSTRAINT `Census_ibfk_2` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`);
873

  
874
--
875
-- Constraints for table `CensusQuadrat`
876
--
877
ALTER TABLE `CensusQuadrat`
878
  ADD CONSTRAINT `CensusQuadrat_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
879
  ADD CONSTRAINT `CensusQuadrat_ibfk_2` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
880
  ADD CONSTRAINT `CensusQuadrat_ibfk_3` FOREIGN KEY (`QuadratID`, `PlotID`) REFERENCES `Quadrat` (`QuadratID`, `PlotID`),
881
  ADD CONSTRAINT `CensusQuadrat_ibfk_4` FOREIGN KEY (`QuadratID`, `PlotID`) REFERENCES `Quadrat` (`QuadratID`, `PlotID`);
882

  
883
--
884
-- Constraints for table `CurrentObsolete`
885
--
886
ALTER TABLE `CurrentObsolete`
887
  ADD CONSTRAINT `CurrentObsolete_ibfk_1` FOREIGN KEY (`ObsoleteSpeciesID`) REFERENCES `Species` (`SpeciesID`),
888
  ADD CONSTRAINT `CurrentObsolete_ibfk_2` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
889
  ADD CONSTRAINT `CurrentObsolete_ibfk_3` FOREIGN KEY (`ObsoleteSpeciesID`) REFERENCES `Species` (`SpeciesID`),
890
  ADD CONSTRAINT `CurrentObsolete_ibfk_4` FOREIGN KEY (`ChangeCodeID`) REFERENCES `TreeTaxChange` (`ChangeCodeID`),
891
  ADD CONSTRAINT `CurrentObsolete_ibfk_5` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
892
  ADD CONSTRAINT `CurrentObsolete_ibfk_6` FOREIGN KEY (`ChangeCodeID`) REFERENCES `TreeTaxChange` (`ChangeCodeID`);
893

  
894
--
895
-- Constraints for table `DataCollection`
896
--
897
ALTER TABLE `DataCollection`
898
  ADD CONSTRAINT `DataCollection_ibfk_1` FOREIGN KEY (`RoleID`) REFERENCES `RoleReference` (`RoleID`),
899
  ADD CONSTRAINT `DataCollection_ibfk_2` FOREIGN KEY (`CensusID`, `QuadratID`, `PlotID`) REFERENCES `CensusQuadrat` (`CensusID`, `QuadratID`, `PlotID`),
900
  ADD CONSTRAINT `DataCollection_ibfk_3` FOREIGN KEY (`PersonnelID`) REFERENCES `Personnel` (`PersonnelID`),
901
  ADD CONSTRAINT `DataCollection_ibfk_4` FOREIGN KEY (`RoleID`) REFERENCES `RoleReference` (`RoleID`),
902
  ADD CONSTRAINT `DataCollection_ibfk_5` FOREIGN KEY (`CensusID`, `QuadratID`, `PlotID`) REFERENCES `CensusQuadrat` (`CensusID`, `QuadratID`, `PlotID`),
903
  ADD CONSTRAINT `DataCollection_ibfk_6` FOREIGN KEY (`PersonnelID`) REFERENCES `Personnel` (`PersonnelID`);
904

  
905
--
906
-- Constraints for table `DataEntry`
907
--
908
ALTER TABLE `DataEntry`
909
  ADD CONSTRAINT `DataEntry_ibfk_1` FOREIGN KEY (`CensusID`, `QuadratID`, `PlotID`) REFERENCES `CensusQuadrat` (`CensusID`, `QuadratID`, `PlotID`),
910
  ADD CONSTRAINT `DataEntry_ibfk_2` FOREIGN KEY (`CensusID`, `QuadratID`, `PlotID`) REFERENCES `CensusQuadrat` (`CensusID`, `QuadratID`, `PlotID`),
911
  ADD CONSTRAINT `DataEntry_ibfk_3` FOREIGN KEY (`PersonnelID`) REFERENCES `Personnel` (`PersonnelID`);
912

  
913
--
914
-- Constraints for table `Family`
915
--
916
ALTER TABLE `Family`
917
  ADD CONSTRAINT `Family_ibfk_1` FOREIGN KEY (`ReferenceID`) REFERENCES `Reference` (`ReferenceID`);
918

  
919
--
920
-- Constraints for table `Genus`
921
--
922
ALTER TABLE `Genus`
923
  ADD CONSTRAINT `Genus_ibfk_1` FOREIGN KEY (`FamilyID`) REFERENCES `Family` (`FamilyID`),
924
  ADD CONSTRAINT `Genus_ibfk_2` FOREIGN KEY (`FamilyID`) REFERENCES `Family` (`FamilyID`),
925
  ADD CONSTRAINT `Genus_ibfk_3` FOREIGN KEY (`ReferenceID`) REFERENCES `Reference` (`ReferenceID`),
926
  ADD CONSTRAINT `Genus_ibfk_4` FOREIGN KEY (`ReferenceID`) REFERENCES `Reference` (`ReferenceID`);
927

  
928
--
929
-- Constraints for table `LogMAttrHistory`
930
--
931
ALTER TABLE `LogMAttrHistory`
932
  ADD CONSTRAINT `LogMAttrHistory_ibfk_1` FOREIGN KEY (`MeasureID`, `CensusID`, `TSMID`) REFERENCES `MeasurementAttributes` (`MeasureID`, `CensusID`, `TSMID`);
933

  
934
--
935
-- Constraints for table `LogMeasurementHistory`
936
--
937
ALTER TABLE `LogMeasurementHistory`
938
  ADD CONSTRAINT `LogMeasurementHistory_ibfk_1` FOREIGN KEY (`MeasureID`, `CensusID`) REFERENCES `Measurement` (`MeasureID`, `CensusID`);
939

  
940
--
941
-- Constraints for table `LogTreeAttrHistory`
942
--
943
ALTER TABLE `LogTreeAttrHistory`
944
  ADD CONSTRAINT `LogTreeAttrHistory_ibfk_1` FOREIGN KEY (`CensusID`, `TreeID`, `TSMID`) REFERENCES `TreeAttributes` (`CensusID`, `TreeID`, `TSMID`);
945

  
946
--
947
-- Constraints for table `LogTreeHistory`
948
--
949
ALTER TABLE `LogTreeHistory`
950
  ADD CONSTRAINT `LogTreeHistory_ibfk_1` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`);
951

  
952
--
953
-- Constraints for table `Measurement`
954
--
955
ALTER TABLE `Measurement`
956
  ADD CONSTRAINT `Measurement_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
957
  ADD CONSTRAINT `Measurement_ibfk_2` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
958
  ADD CONSTRAINT `Measurement_ibfk_3` FOREIGN KEY (`StemID`, `TreeID`) REFERENCES `Stem` (`StemID`, `TreeID`),
959
  ADD CONSTRAINT `Measurement_ibfk_4` FOREIGN KEY (`StemID`, `TreeID`) REFERENCES `Stem` (`StemID`, `TreeID`);
960

  
961
--
962
-- Constraints for table `MeasurementAttributes`
963
--
964
ALTER TABLE `MeasurementAttributes`
965
  ADD CONSTRAINT `MeasurementAttributes_ibfk_1` FOREIGN KEY (`MeasureID`, `CensusID`) REFERENCES `Measurement` (`MeasureID`, `CensusID`),
966
  ADD CONSTRAINT `MeasurementAttributes_ibfk_2` FOREIGN KEY (`MeasureID`, `CensusID`) REFERENCES `Measurement` (`MeasureID`, `CensusID`),
967
  ADD CONSTRAINT `MeasurementAttributes_ibfk_3` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`);
968

  
969
--
970
-- Constraints for table `Quadrat`
971
--
972
ALTER TABLE `Quadrat`
973
  ADD CONSTRAINT `Quadrat_ibfk_1` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`),
974
  ADD CONSTRAINT `Quadrat_ibfk_2` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`);
975

  
976
--
977
-- Constraints for table `RemeasAttribs`
978
--
979
ALTER TABLE `RemeasAttribs`
980
  ADD CONSTRAINT `RemeasAttribs_ibfk_1` FOREIGN KEY (`RemeasureID`, `CensusID`) REFERENCES `Remeasurement` (`RemeasureID`, `CensusID`),
981
  ADD CONSTRAINT `RemeasAttribs_ibfk_2` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`),
982
  ADD CONSTRAINT `RemeasAttribs_ibfk_3` FOREIGN KEY (`RemeasureID`, `CensusID`) REFERENCES `Remeasurement` (`RemeasureID`, `CensusID`),
983
  ADD CONSTRAINT `RemeasAttribs_ibfk_4` FOREIGN KEY (`TSMID`) REFERENCES `TSMAttributes` (`TSMID`);
984

  
985
--
986
-- Constraints for table `Remeasurement`
987
--
988
ALTER TABLE `Remeasurement`
989
  ADD CONSTRAINT `Remeasurement_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
990
  ADD CONSTRAINT `Remeasurement_ibfk_2` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`),
991
  ADD CONSTRAINT `Remeasurement_ibfk_3` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
992
  ADD CONSTRAINT `Remeasurement_ibfk_4` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`);
993

  
994
--
995
-- Constraints for table `Site`
996
--
997
ALTER TABLE `Site`
998
  ADD CONSTRAINT `Site_ibfk_1` FOREIGN KEY (`CountryID`) REFERENCES `Country` (`CountryID`),
999
  ADD CONSTRAINT `Site_ibfk_2` FOREIGN KEY (`CountryID`) REFERENCES `Country` (`CountryID`);
1000

  
1001
--
1002
-- Constraints for table `Species`
1003
--
1004
ALTER TABLE `Species`
1005
  ADD CONSTRAINT `Species_ibfk_1` FOREIGN KEY (`GenusID`) REFERENCES `Genus` (`GenusID`),
1006
  ADD CONSTRAINT `Species_ibfk_2` FOREIGN KEY (`GenusID`) REFERENCES `Genus` (`GenusID`);
1007

  
1008
--
1009
-- Constraints for table `SpeciesInventory`
1010
--
1011
ALTER TABLE `SpeciesInventory`
1012
  ADD CONSTRAINT `SpeciesInventory_ibfk_1` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
1013
  ADD CONSTRAINT `SpeciesInventory_ibfk_2` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`),
1014
  ADD CONSTRAINT `SpeciesInventory_ibfk_3` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1015
  ADD CONSTRAINT `SpeciesInventory_ibfk_4` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`),
1016
  ADD CONSTRAINT `SpeciesInventory_ibfk_5` FOREIGN KEY (`CensusID`) REFERENCES `Census` (`CensusID`),
1017
  ADD CONSTRAINT `SpeciesInventory_ibfk_6` FOREIGN KEY (`PlotID`) REFERENCES `Site` (`PlotID`),
1018
  ADD CONSTRAINT `SpeciesInventory_ibfk_7` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1019
  ADD CONSTRAINT `SpeciesInventory_ibfk_8` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`);
1020

  
1021
--
1022
-- Constraints for table `Specimen`
1023
--
1024
ALTER TABLE `Specimen`
1025
  ADD CONSTRAINT `Specimen_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1026
  ADD CONSTRAINT `Specimen_ibfk_2` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`),
1027
  ADD CONSTRAINT `Specimen_ibfk_3` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`),
1028
  ADD CONSTRAINT `Specimen_ibfk_4` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1029
  ADD CONSTRAINT `Specimen_ibfk_5` FOREIGN KEY (`SubSpeciesID`) REFERENCES `SubSpecies` (`SubSpeciesID`),
1030
  ADD CONSTRAINT `Specimen_ibfk_6` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`);
1031

  
1032
--
1033
-- Constraints for table `StageSource`
1034
--
1035
ALTER TABLE `StageSource`
1036
  ADD CONSTRAINT `StageSource_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1037
  ADD CONSTRAINT `StageSource_ibfk_2` FOREIGN KEY (`ChangeID`) REFERENCES `StageTaxonomicChanges` (`ChangeID`);
1038

  
1039
--
1040
-- Constraints for table `StageTarget`
1041
--
1042
ALTER TABLE `StageTarget`
1043
  ADD CONSTRAINT `StageTarget_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1044
  ADD CONSTRAINT `StageTarget_ibfk_2` FOREIGN KEY (`ChangeID`) REFERENCES `StageTaxonomicChanges` (`ChangeID`);
1045

  
1046
--
1047
-- Constraints for table `StageTargetNew`
1048
--
1049
ALTER TABLE `StageTargetNew`
1050
  ADD CONSTRAINT `StageTargetNew_ibfk_1` FOREIGN KEY (`ChangeID`) REFERENCES `StageTaxonomicChanges` (`ChangeID`);
1051

  
1052
--
1053
-- Constraints for table `StageTaxonomicChanges`
1054
--
1055
ALTER TABLE `StageTaxonomicChanges`
1056
  ADD CONSTRAINT `StageTaxonomicChanges_ibfk_1` FOREIGN KEY (`PersonnelID`) REFERENCES `Personnel` (`PersonnelID`),
1057
  ADD CONSTRAINT `StageTaxonomicChanges_ibfk_2` FOREIGN KEY (`ChangeCodeID`) REFERENCES `TreeTaxChange` (`ChangeCodeID`);
1058

  
1059
--
1060
-- Constraints for table `Stem`
1061
--
1062
ALTER TABLE `Stem`
1063
  ADD CONSTRAINT `Stem_ibfk_1` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`),
1064
  ADD CONSTRAINT `Stem_ibfk_2` FOREIGN KEY (`TreeID`) REFERENCES `Tree` (`TreeID`);
1065

  
1066
--
1067
-- Constraints for table `SubSpecies`
1068
--
1069
ALTER TABLE `SubSpecies`
1070
  ADD CONSTRAINT `SubSpecies_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
1071
  ADD CONSTRAINT `SubSpecies_ibfk_2` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`);
1072

  
1073
--
1074
-- Constraints for table `Tree`
1075
--
1076
ALTER TABLE `Tree`
1077
  ADD CONSTRAINT `Tree_ibfk_1` FOREIGN KEY (`SpeciesID`) REFERENCES `Species` (`SpeciesID`),
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff