-- MySQL dump 10.13  Distrib 5.5.28, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: salvias_plots
-- ------------------------------------------------------
-- Server version	5.5.28-0ubuntu0.12.04.2

/*!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 latin1 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,POSTGRESQL' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table "PlotMetadata"
--

DROP TABLE IF EXISTS "PlotMetadata";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "PlotMetadata" (
  "PlotID" int(11) NOT NULL,
  "orig_filename" longtext,
  "AccessCode" smallint(6) DEFAULT NULL,
  "project_id" int(11) DEFAULT NULL,
  "PrimOwnerID" varchar(30) DEFAULT NULL,
  "SiteCode" varchar(100) DEFAULT NULL,
  "SiteName" varchar(150) DEFAULT NULL,
  "new_world" char(3) DEFAULT NULL,
  "MajorGeo" varchar(255) DEFAULT NULL,
  "Country" varchar(80) DEFAULT NULL,
  "PolDiv1" varchar(50) DEFAULT NULL,
  "pol1_type" varchar(25) DEFAULT NULL,
  "pol2" varchar(50) DEFAULT NULL,
  "pol2_type" varchar(25) DEFAULT NULL,
  "lat_string" varchar(100) DEFAULT NULL,
  "long_string" varchar(100) DEFAULT NULL,
  "LatDec" float DEFAULT NULL,
  "LongDec" float DEFAULT NULL,
  "lat_long_accuracy" varchar(255) DEFAULT NULL,
  "Elev" float DEFAULT NULL,
  "elev_max_m" float DEFAULT NULL,
  "elev_min_m" float DEFAULT NULL,
  "Precip" float DEFAULT NULL,
  "ElevSource" float DEFAULT NULL,
  "Temp" float DEFAULT NULL,
  "PrecipSource" float DEFAULT NULL,
  "TempSource" varchar(255) DEFAULT NULL,
  "bearing" double unsigned DEFAULT NULL,
  "slope_aspect" varchar(10) DEFAULT NULL,
  "slope_gradient" smallint(6) DEFAULT NULL,
  "clay_percent" float unsigned DEFAULT NULL,
  "silt_percent" float unsigned DEFAULT NULL,
  "sand_percent" float unsigned DEFAULT NULL,
  "pH" float unsigned DEFAULT NULL,
  "soil_N" varchar(20) DEFAULT NULL,
  "soil_P" varchar(20) DEFAULT NULL,
  "soil_C" varchar(20) DEFAULT NULL,
  "soil_K" varchar(20) DEFAULT NULL,
  "soil_Mg" varchar(20) DEFAULT NULL,
  "soil_Ca" varchar(20) DEFAULT NULL,
  "soil_Na" varchar(20) DEFAULT NULL,
  "soil_acidity" varchar(20) DEFAULT NULL,
  "soil_base" varchar(20) DEFAULT NULL,
  "soil_cation_cap" varchar(20) DEFAULT NULL,
  "soil_conductivity" varchar(20) DEFAULT NULL,
  "organic_percent" float unsigned DEFAULT NULL,
  "soil_texture" varchar(20) DEFAULT NULL,
  "RevisionComments" varchar(255) DEFAULT NULL,
  "Locality_Description" varchar(250) DEFAULT NULL,
  "topography_desc" varchar(250) DEFAULT NULL,
  "vegetation_1" varchar(255) DEFAULT NULL,
  "vegetation_2" varchar(255) DEFAULT NULL,
  "Habitat" varchar(250) DEFAULT NULL,
  "life_zone_code" varchar(10) DEFAULT NULL,
  "life_zone" varchar(150) DEFAULT NULL,
  "PlotMethod" varchar(250) DEFAULT NULL,
  "MethodCode" smallint(6) DEFAULT NULL,
  "plot_area_ha" float DEFAULT NULL,
  "recensused" char(3) DEFAULT NULL,
  "date_start" varchar(20) DEFAULT NULL,
  "date_finish" varchar(20) DEFAULT NULL,
  "plot_administrator" varchar(30) DEFAULT NULL,
  "plot_notes" longtext,
  "tmp_del" char(3) DEFAULT NULL,
  PRIMARY KEY ("PlotID"),
  KEY "Country" ("Country"),
  KEY "PrimOwnerID" ("PrimOwnerID"),
  KEY "plot_administrator" ("plot_administrator"),
  KEY "project_id" ("project_id"),
  KEY "tmp_del" ("tmp_del")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "PlotObservations"
--

DROP TABLE IF EXISTS "PlotObservations";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "PlotObservations" (
  "PlotObsID" int(11) NOT NULL,
  "PlotID" int(11) DEFAULT NULL,
  "PlotCode" varchar(50) DEFAULT NULL,
  "census_no" int(10) unsigned DEFAULT NULL,
  "census_date" varchar(20) DEFAULT NULL,
  "OrigRecordID" int(11) DEFAULT NULL,
  "Line" varchar(50) DEFAULT NULL,
  "Ind" int(11) DEFAULT NULL,
  "ind_id" varchar(11) DEFAULT NULL,
  "tag1" varchar(10) DEFAULT NULL,
  "tag2" varchar(10) DEFAULT NULL,
  "x_position" int(11) DEFAULT NULL,
  "y_position" int(11) DEFAULT NULL,
  "dist" double(10,3) DEFAULT NULL,
  "perp_dist" varchar(5) DEFAULT NULL,
  "SourceVoucher" varchar(100) DEFAULT NULL,
  "coll_number" varchar(50) DEFAULT NULL,
  "collector_code" varchar(20) DEFAULT NULL,
  "coll_inits" varchar(8) DEFAULT NULL,
  "coll_lastname" varchar(50) DEFAULT NULL,
  "coll_firstname" varchar(50) DEFAULT NULL,
  "DetType" varchar(255) DEFAULT NULL,
  "det_by" varchar(250) DEFAULT NULL,
  "fam_status" tinyint(4) DEFAULT NULL,
  "gen_status" tinyint(4) DEFAULT NULL,
  "name_status" tinyint(4) DEFAULT NULL,
  "SpAuthStatus" tinyint(4) DEFAULT NULL,
  "Family" varchar(255) DEFAULT NULL,
  "Genus" varchar(255) DEFAULT NULL,
  "GenAuth" varchar(255) DEFAULT NULL,
  "Species" varchar(255) DEFAULT NULL,
  "auth" varchar(255) DEFAULT NULL,
  "infra_rank_1" varchar(6) DEFAULT NULL,
  "infra_ep_1" varchar(150) DEFAULT NULL,
  "infra_auth_1" varchar(150) DEFAULT NULL,
  "common_name" varchar(100) DEFAULT NULL,
  "morphoname" varchar(200) DEFAULT NULL,
  "species_code" varchar(50) DEFAULT NULL,
  "Habit" varchar(50) DEFAULT NULL,
  "height_class" varchar(20) DEFAULT NULL,
  "height_m" float(2,1) DEFAULT NULL,
  "height_m_commercial" float(2,1) unsigned DEFAULT NULL,
  "ht_first_branch_m" double DEFAULT NULL,
  "NoInd" int(11) DEFAULT NULL,
  "cover_percent" decimal(7,2) DEFAULT NULL,
  "intercept_cm" double DEFAULT NULL,
  "cfaff" varchar(10) DEFAULT NULL,
  "other_annotations" varchar(250) DEFAULT NULL,
  "morphocf" varchar(10) DEFAULT NULL,
  "IsMorpho" tinyint(1) DEFAULT NULL,
  "OrigFamily" varchar(100) DEFAULT NULL,
  "OrigGenus" varchar(100) DEFAULT NULL,
  "OrigSpecies" varchar(255) DEFAULT NULL,
  "OrigAuth" varchar(250) DEFAULT NULL,
  "phenology" varchar(250) DEFAULT NULL,
  "canopy_position" varchar(50) DEFAULT NULL,
  "canopy_form" varchar(50) DEFAULT NULL,
  "liana_infestation" varchar(50) DEFAULT NULL,
  "Notes" text,
  "tmp_PlotObsID" int(11) unsigned DEFAULT NULL,
  "temp_dbh" double(10,3) DEFAULT NULL,
  "temp_liandbh" double(10,3) DEFAULT NULL,
  "tmp_del" char(3) DEFAULT NULL,
  PRIMARY KEY ("PlotObsID"),
  KEY "PlotID" ("PlotID"),
  KEY "tmp_del" ("tmp_del"),
  KEY "tmp_PlotObsID" ("tmp_PlotObsID")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "log_plot_download"
--

DROP TABLE IF EXISTS "log_plot_download";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "log_plot_download" (
  "EnteredBy" varchar(14) NOT NULL DEFAULT '',
  "download_timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "ip" varchar(21) NOT NULL DEFAULT '',
  "plot_id" int(11) DEFAULT NULL,
  "plot_administrator" varchar(30) NOT NULL DEFAULT '',
  "project_id" int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY ("EnteredBy","download_timestamp"),
  KEY "plot_administrator" ("plot_administrator","project_id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "lookup_MethodCode"
--

DROP TABLE IF EXISTS "lookup_MethodCode";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "lookup_MethodCode" (
  "MethodCode" int(11) NOT NULL DEFAULT '0',
  "Description" varchar(80) NOT NULL DEFAULT '',
  PRIMARY KEY ("MethodCode")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "lookup_plot_security_levels"
--

DROP TABLE IF EXISTS "lookup_plot_security_levels";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "lookup_plot_security_levels" (
  "level" smallint(6) NOT NULL DEFAULT '0',
  "description" varchar(30) NOT NULL DEFAULT '',
  PRIMARY KEY ("level")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "permissions_plot_user"
--

DROP TABLE IF EXISTS "permissions_plot_user";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "permissions_plot_user" (
  "plot_id" int(11) NOT NULL DEFAULT '0',
  "username" varchar(50) NOT NULL DEFAULT '',
  "access_level" mediumint(9) NOT NULL DEFAULT '0',
  PRIMARY KEY ("plot_id","username"),
  KEY "access_level" ("access_level")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "plotMetadata"
--

DROP TABLE IF EXISTS "plotMetadata";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "plotMetadata" (
  "PlotID" int(11) NOT NULL,
  "orig_filename" longtext,
  "AccessCode" smallint(6) DEFAULT NULL,
  "project_id" int(11) DEFAULT NULL,
  "PrimOwnerID" varchar(30) DEFAULT NULL,
  "SiteCode" varchar(100) DEFAULT NULL,
  "SiteName" varchar(150) DEFAULT NULL,
  "new_world" char(3) DEFAULT NULL,
  "MajorGeo" varchar(255) DEFAULT NULL,
  "Country" varchar(80) DEFAULT NULL,
  "PolDiv1" varchar(50) DEFAULT NULL,
  "pol1_type" varchar(25) DEFAULT NULL,
  "pol2" varchar(50) DEFAULT NULL,
  "pol2_type" varchar(25) DEFAULT NULL,
  "lat_string" varchar(20) DEFAULT NULL,
  "long_string" varchar(20) DEFAULT NULL,
  "LatDec" float DEFAULT NULL,
  "LongDec" float DEFAULT NULL,
  "lat_long_accuracy" varchar(255) DEFAULT NULL,
  "Elev" float DEFAULT NULL,
  "elev_max_m" float DEFAULT NULL,
  "elev_min_m" float DEFAULT NULL,
  "Precip" float DEFAULT NULL,
  "ElevSource" float DEFAULT NULL,
  "Temp" float DEFAULT NULL,
  "PrecipSource" float DEFAULT NULL,
  "TempSource" varchar(255) DEFAULT NULL,
  "bearing" double unsigned DEFAULT NULL,
  "slope_aspect" varchar(10) DEFAULT NULL,
  "slope_gradient" smallint(6) DEFAULT NULL,
  "clay_percent" float unsigned DEFAULT NULL,
  "silt_percent" float unsigned DEFAULT NULL,
  "sand_percent" float unsigned DEFAULT NULL,
  "pH" float unsigned DEFAULT NULL,
  "soil_N" varchar(20) DEFAULT NULL,
  "soil_P" varchar(20) DEFAULT NULL,
  "soil_C" varchar(20) DEFAULT NULL,
  "soil_K" varchar(20) DEFAULT NULL,
  "soil_Mg" varchar(20) DEFAULT NULL,
  "soil_Ca" varchar(20) DEFAULT NULL,
  "soil_Na" varchar(20) DEFAULT NULL,
  "soil_acidity" varchar(20) DEFAULT NULL,
  "soil_base" varchar(20) DEFAULT NULL,
  "soil_cation_cap" varchar(20) DEFAULT NULL,
  "soil_conductivity" varchar(20) DEFAULT NULL,
  "organic_percent" float unsigned DEFAULT NULL,
  "soil_texture" varchar(20) DEFAULT NULL,
  "RevisionComments" varchar(255) DEFAULT NULL,
  "Locality_Description" varchar(250) DEFAULT NULL,
  "topography_desc" varchar(250) DEFAULT NULL,
  "vegetation_1" varchar(255) DEFAULT NULL,
  "vegetation_2" varchar(255) DEFAULT NULL,
  "Habitat" varchar(250) DEFAULT NULL,
  "life_zone_code" varchar(10) DEFAULT NULL,
  "life_zone" varchar(150) DEFAULT NULL,
  "PlotMethod" varchar(250) DEFAULT NULL,
  "MethodCode" smallint(6) DEFAULT NULL,
  "plot_area_ha" float DEFAULT NULL,
  "recensused" char(3) DEFAULT NULL,
  "date_start" varchar(20) DEFAULT NULL,
  "date_finish" varchar(20) DEFAULT NULL,
  "plot_administrator" varchar(30) DEFAULT NULL,
  "plot_notes" longtext,
  "tmp_del" char(3) DEFAULT NULL,
  PRIMARY KEY ("PlotID"),
  KEY "Country" ("Country"),
  KEY "PrimOwnerID" ("PrimOwnerID"),
  KEY "plot_administrator" ("plot_administrator"),
  KEY "project_id" ("project_id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "projects"
--

DROP TABLE IF EXISTS "projects";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "projects" (
  "project_id" int(11) NOT NULL,
  "project_name" varchar(255) NOT NULL DEFAULT '',
  "project_pi" varchar(30) NOT NULL DEFAULT '',
  "allow_download_all" tinyint(1) NOT NULL DEFAULT '0',
  "ipr_specific" longtext,
  "ipr_specific_updated" date DEFAULT NULL,
  PRIMARY KEY ("project_id"),
  KEY "project_name" ("project_name"),
  KEY "on_project_list" ("allow_download_all"),
  KEY "project_distinct" ("project_id","project_name","project_pi")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "stems"
--

DROP TABLE IF EXISTS "stems";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "stems" (
  "stem_id" int(11) unsigned NOT NULL,
  "origrecord_id_stems" int(11) unsigned DEFAULT NULL,
  "PlotObsID" int(11) DEFAULT NULL,
  "NoInd" int(11) DEFAULT '0',
  "basal_diam" double DEFAULT NULL,
  "stem_dbh" double DEFAULT NULL,
  "gentry_dbh" double DEFAULT NULL,
  "stem_notes" longtext,
  "stem_tag1" varchar(20) DEFAULT NULL,
  "stem_tag2" varchar(20) DEFAULT NULL,
  "stem_height_m" double DEFAULT NULL,
  "stem_height_first_branch_m" double DEFAULT NULL,
  "stem_canopy_form" varchar(50) DEFAULT NULL,
  "stem_canopy_position" varchar(50) DEFAULT NULL,
  "stem_liana_infestation" varchar(50) DEFAULT NULL,
  "tmp_del" char(3) DEFAULT NULL,
  PRIMARY KEY ("stem_id"),
  KEY "plotobs_id" ("PlotObsID")
);
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2012-11-14 15:48:54
