SET standard_conforming_strings = off;
SET escape_string_warning = off;
-- MySQL dump 10.13  Distrib 5.5.28, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: salvias_users
-- ------------------------------------------------------
-- Server version	5.5.28-0ubuntu0.12.04.3

/*!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 */;
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 "affiliation_lookup"
--

DROP TABLE IF EXISTS "affiliation_lookup";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "affiliation_lookup" (
  "affiliation_id" integer NOT NULL,
  "description" varchar(200) NOT NULL DEFAULT '',
  PRIMARY KEY ("affiliation_id"),
  "description_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "applications"
--

DROP TABLE IF EXISTS "applications";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "applications" (
  "app_id" integer NOT NULL,
  "description" varchar(150) DEFAULT NULL,
  "name" varchar(50) NOT NULL DEFAULT '',
  "admin_email" varchar(100) DEFAULT NULL,
  "http_location" varchar(255) DEFAULT NULL,
  PRIMARY KEY ("app_id"),
  "name_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "country"
--

DROP TABLE IF EXISTS "country";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "country" (
  "country" varchar(50) DEFAULT NULL,
  "country_id" integer NOT NULL,
  PRIMARY KEY ("country_id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "institution_lookup"
--

DROP TABLE IF EXISTS "institution_lookup";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "institution_lookup" (
  "institution_id" integer NOT NULL,
  "Address" varchar(100) DEFAULT NULL,
  "City" varchar(80) DEFAULT NULL,
  "State" char(2) DEFAULT NULL,
  "Zipcode" varchar(10) DEFAULT NULL,
  "Country" varchar(50) DEFAULT NULL,
  "IsHerbarium" integer NOT NULL DEFAULT '0',
  "Phone" varchar(20) DEFAULT NULL,
  "Fax" varchar(20) DEFAULT NULL,
  "Email" varchar(120) DEFAULT NULL,
  "URL" varchar(250) DEFAULT NULL,
  "Spec_URL" varchar(250) DEFAULT NULL,
  "Tx_URL" varchar(250) DEFAULT NULL,
  "Name" varchar(150) NOT NULL DEFAULT '',
  PRIMARY KEY ("institution_id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "ipr"
--

DROP TABLE IF EXISTS "ipr";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "ipr" (
  "IPR_ID" integer NOT NULL DEFAULT '0',
  "ipr_general" text NOT NULL,
  "ipr_general_updated" date NOT NULL DEFAULT '-infinity',
  "ipr_updated_by" varchar(50) NOT NULL DEFAULT '',
  "ipr_general_version" varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY ("IPR_ID")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "licence_lookup"
--

DROP TABLE IF EXISTS "licence_lookup";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "licence_lookup" (
  "id" integer NOT NULL,
  "version" varchar(5) NOT NULL DEFAULT '',
  "filename" varchar(30) NOT NULL DEFAULT '',
  "created" date NOT NULL DEFAULT '-infinity',
  "status" char(1) NOT NULL DEFAULT 'A',
  "ipr_brief_text" text,
  PRIMARY KEY ("id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "licence_user_lookup"
--

DROP TABLE IF EXISTS "licence_user_lookup";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "licence_user_lookup" (
  "username" varchar(30) NOT NULL DEFAULT '',
  "licence_id" integer NOT NULL DEFAULT '0',
  "accepted" char(1) NOT NULL DEFAULT '',
  "date" date NOT NULL DEFAULT '-infinity'
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "page_access"
--

DROP TABLE IF EXISTS "page_access";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "page_access" (
  "page" varchar(80) NOT NULL DEFAULT '',
  "group_id" integer NOT NULL DEFAULT '0',
  "app_id" integer NOT NULL DEFAULT '0',
  PRIMARY KEY ("page","group_id"),
  "app_id_index" boolean,
  "page_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "page_define"
--

DROP TABLE IF EXISTS "page_define";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "page_define" (
  "page" varchar(80) NOT NULL DEFAULT '',
  "app_id" integer NOT NULL DEFAULT '0',
  "fail_msg" varchar(250) DEFAULT NULL,
  "description" varchar(250) DEFAULT NULL,
  "allow_request" integer NOT NULL DEFAULT '0',
  "show_description" integer NOT NULL DEFAULT '0',
  PRIMARY KEY ("page","app_id"),
  "allow_request_index" boolean,
  "show_description_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "page_requests"
--

DROP TABLE IF EXISTS "page_requests";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "page_requests" (
  "id" integer NOT NULL,
  "page" varchar(80) NOT NULL DEFAULT '',
  "username" varchar(30) NOT NULL DEFAULT '',
  "denied" integer NOT NULL DEFAULT '0',
  "comments" varchar(255) DEFAULT NULL,
  PRIMARY KEY ("id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_banned"
--

DROP TABLE IF EXISTS "tbl_banned";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_banned" (
  "ip" varchar(16) NOT NULL DEFAULT '',
  "app_id" integer DEFAULT NULL,
  PRIMARY KEY ("ip"),
  "app_id_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_dl"
--

DROP TABLE IF EXISTS "tbl_dl";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_dl" (
  "dl_id" bigint NOT NULL,
  "dl_login_id" bigint NOT NULL DEFAULT '0',
  "dl_target" varchar(50) NOT NULL DEFAULT '',
  "dl_target_url" varchar(250) NOT NULL DEFAULT '',
  "dl_timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY ("dl_id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_dl_login"
--

DROP TABLE IF EXISTS "tbl_dl_login";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_dl_login" (
  "dl_login_id" bigint NOT NULL,
  "dl_page_src" varchar(250) NOT NULL DEFAULT '',
  "dl_page_target" varchar(250) NOT NULL DEFAULT '',
  "lname" varchar(50) NOT NULL DEFAULT '',
  "fname" varchar(50) NOT NULL DEFAULT '',
  "institution" varchar(200) DEFAULT NULL,
  "email" varchar(200) NOT NULL DEFAULT '',
  "comments" bytea,
  "timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY ("dl_login_id")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_group"
--

DROP TABLE IF EXISTS "tbl_group";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_group" (
  "username" varchar(40) NOT NULL DEFAULT '',
  "gid" integer NOT NULL DEFAULT '-1',
  PRIMARY KEY ("username","gid")
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_group_define"
--

DROP TABLE IF EXISTS "tbl_group_define";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_group_define" (
  "gid" integer NOT NULL,
  "app_id" integer NOT NULL DEFAULT '0',
  "group_name" varchar(80) NOT NULL DEFAULT '',
  "description" varchar(200) DEFAULT NULL,
  "parent_gid" integer DEFAULT NULL,
  "group_admin_email" varchar(80) NOT NULL DEFAULT '',
  "allow_request" integer NOT NULL DEFAULT '0',
  PRIMARY KEY ("gid"),
  "group_admin_email_index" boolean,
  "allow_request_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_log"
--

DROP TABLE IF EXISTS "tbl_log";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_log" (
  "log_id" integer NOT NULL,
  "lastusage" integer DEFAULT NULL,
  "timestamp" integer NOT NULL DEFAULT '0',
  "ip" varchar(16) NOT NULL DEFAULT 'no ip logged',
  "username" varchar(40) DEFAULT NULL,
  "action" varchar(40) DEFAULT NULL,
  "app_id" integer DEFAULT NULL,
  PRIMARY KEY ("log_id"),
  "timestamp_index" boolean,
  "app_id_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "tbl_users"
--

DROP TABLE IF EXISTS "tbl_users";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "tbl_users" (
  "id" integer NOT NULL,
  "username" varchar(30) NOT NULL DEFAULT '',
  "password" varchar(250) DEFAULT NULL,
  "lname" varchar(25) DEFAULT NULL,
  "fname" varchar(25) DEFAULT NULL,
  "email" varchar(100) DEFAULT NULL,
  "alt_email" varchar(60) DEFAULT NULL,
  "html_link_id" integer DEFAULT NULL,
  "address" varchar(200) DEFAULT NULL,
  "city" varchar(100) DEFAULT NULL,
  "state" varchar(11) DEFAULT NULL,
  "zip" varchar(15) DEFAULT NULL,
  "phone" varchar(25) DEFAULT NULL,
  "country_id" integer DEFAULT NULL,
  "room_number" varchar(10) DEFAULT NULL,
  "institution_id" integer DEFAULT NULL,
  "Department" varchar(50) DEFAULT NULL,
  "spec_dq_priority" integer NOT NULL DEFAULT '0',
  PRIMARY KEY ("id"),
  "login_index" boolean
);
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table "user_status"
--

DROP TABLE IF EXISTS "user_status";
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE "user_status" (
  "username" varchar(30) NOT NULL DEFAULT '',
  "ip" varchar(16) DEFAULT NULL,
  "lastusage" integer NOT NULL DEFAULT '0',
  "app_id" integer NOT NULL DEFAULT '0',
  "tries" integer DEFAULT NULL,
  "nextlogin" integer DEFAULT NULL,
  PRIMARY KEY ("username","app_id"),
  "ip_index" boolean
);
/*!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-12-11  9:53:05
