-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 20, 2013 at 11:52 AM
-- Server version: 5.5.16
-- PHP Version: 5.3.8

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: `help_to_care`
--

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

--
-- Table structure for table `calendar`
--

CREATE TABLE IF NOT EXISTS `calendar` (
  `calendarid` int(11) NOT NULL AUTO_INCREMENT,
  `calendar_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`calendarid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `contact`
--

CREATE TABLE IF NOT EXISTS `contact` (
  `contactid` int(11) NOT NULL AUTO_INCREMENT,
  `contact_name` varchar(50) DEFAULT NULL,
  `business_name` varchar(100) DEFAULT NULL,
  `contact_category` varchar(50) DEFAULT NULL,
  `email_address1` varchar(50) DEFAULT NULL,
  `mobile_number` varchar(50) DEFAULT NULL,
  `work_number` varchar(50) DEFAULT NULL,
  `work_city` varchar(255) DEFAULT NULL,
  `work_state` varchar(255) DEFAULT NULL,
  `work_zip` varchar(255) DEFAULT NULL,
  `work_address` varchar(255) DEFAULT NULL,
  `home_address` varchar(255) DEFAULT NULL,
  `home_city` varchar(255) DEFAULT NULL,
  `home_state` varchar(255) DEFAULT NULL,
  `home_zip` varchar(255) DEFAULT NULL,
  `home_page` varchar(100) DEFAULT NULL,
  `contact_notes` text,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`contactid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `contact_group`
--

CREATE TABLE IF NOT EXISTS `contact_group` (
  `contact_groupid` int(11) NOT NULL AUTO_INCREMENT,
  `contact_group_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`contact_groupid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `document`
--

CREATE TABLE IF NOT EXISTS `document` (
  `documentid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT 'It stores the name of document entered by user',
  `file_name` varchar(255) DEFAULT NULL COMMENT 'It sotres the file name in server.',
  `actual_file_name` varchar(255) DEFAULT NULL,
  `document_description` varchar(100) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`documentid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `document_group`
--

CREATE TABLE IF NOT EXISTS `document_group` (
  `document_groupid` int(11) NOT NULL AUTO_INCREMENT,
  `document_group_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`document_groupid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `events`
--

CREATE TABLE IF NOT EXISTS `events` (
  `eventid` int(11) NOT NULL AUTO_INCREMENT,
  `event_name` varchar(255) DEFAULT NULL,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `where` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `color` varchar(7) NOT NULL,
  `is_all_day` tinyint(4) NOT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`eventid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `folders`
--

CREATE TABLE IF NOT EXISTS `folders` (
  `folderid` int(11) NOT NULL AUTO_INCREMENT,
  `folder_name` varchar(255) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`folderid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `medication`
--

CREATE TABLE IF NOT EXISTS `medication` (
  `medicationid` int(11) NOT NULL AUTO_INCREMENT,
  `med_name` varchar(100) DEFAULT NULL,
  `generic_name` varchar(100) DEFAULT NULL,
  `dosage` varchar(100) DEFAULT NULL,
  `dosage_frequency` varchar(100) DEFAULT NULL,
  `med_notes` text,
  `physician` varchar(100) DEFAULT NULL,
  `date_prescribed` date DEFAULT NULL,
  `pharmacy` varchar(100) DEFAULT NULL,
  `symptoms_address` text,
  `side_effects` text,
  `drug_interactions` text,
  `physical_desc` varchar(255) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`medicationid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `medication_group`
--

CREATE TABLE IF NOT EXISTS `medication_group` (
  `medication_groupid` int(11) NOT NULL AUTO_INCREMENT,
  `medication_group_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`medication_groupid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `person`
--

CREATE TABLE IF NOT EXISTS `person` (
  `personid` int(11) NOT NULL AUTO_INCREMENT,
  `fk_userid` int(11) DEFAULT '0',
  `first_name` varchar(128) CHARACTER SET latin1 DEFAULT NULL,
  `last_name` varchar(128) CHARACTER SET latin1 DEFAULT NULL,
  `phone_main` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `phone_mobile` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `phone_emergency` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `address1` varchar(60) CHARACTER SET latin1 DEFAULT NULL,
  `address2` varchar(60) CHARACTER SET latin1 DEFAULT NULL,
  `city` varchar(60) CHARACTER SET latin1 DEFAULT NULL,
  `state` varchar(2) CHARACTER SET latin1 DEFAULT NULL,
  `zipcode` varchar(16) CHARACTER SET latin1 DEFAULT NULL,
  `email_primary` varchar(128) CHARACTER SET latin1 DEFAULT NULL,
  `email_secondary` varchar(128) CHARACTER SET latin1 DEFAULT NULL,
  `notes` text CHARACTER SET latin1,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`personid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `post`
--

CREATE TABLE IF NOT EXISTS `post` (
  `postid` int(11) NOT NULL AUTO_INCREMENT,
  `post` text,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(2) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(2) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`postid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `provider`
--

CREATE TABLE IF NOT EXISTS `provider` (
  `providerid` int(11) NOT NULL AUTO_INCREMENT,
  `provider_name` varchar(128) DEFAULT NULL,
  `fk_userid` int(11) DEFAULT '0',
  `provider_descr` varchar(128) DEFAULT NULL,
  `phone_main` varchar(30) DEFAULT NULL,
  `phone_mobile` varchar(30) DEFAULT NULL,
  `phone_emergency` varchar(30) DEFAULT NULL,
  `address1` varchar(72) DEFAULT NULL,
  `address2` varchar(72) DEFAULT NULL,
  `city` varchar(60) DEFAULT NULL,
  `state` varchar(30) DEFAULT NULL,
  `zipcode` varchar(16) DEFAULT NULL,
  `email_primary` varchar(60) DEFAULT NULL,
  `email_secondary` varchar(60) DEFAULT NULL,
  `notes` text,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`providerid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `resource`
--

CREATE TABLE IF NOT EXISTS `resource` (
  `resourceid` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `fk_type_recid` int(11) DEFAULT NULL,
  `fk_userid_owner` int(11) DEFAULT NULL,
  `fk_resourceid_parent` int(11) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`resourceid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `task`
--

CREATE TABLE IF NOT EXISTS `task` (
  `taskid` int(11) NOT NULL AUTO_INCREMENT,
  `task_description` varchar(100) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `priority` varchar(24) DEFAULT NULL,
  `person_responsibile` varchar(100) DEFAULT NULL,
  `task_notes` text,
  `is_completed` varchar(5) NOT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`taskid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `task_group`
--

CREATE TABLE IF NOT EXISTS `task_group` (
  `task_groupid` int(11) NOT NULL AUTO_INCREMENT,
  `task_group_name` varchar(60) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`task_groupid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `userid` int(11) NOT NULL AUTO_INCREMENT,
  `email_login` varchar(128) DEFAULT NULL,
  `password` varchar(128) DEFAULT NULL,
  `terms_conditions_agree` tinyint(1) NOT NULL,
  `activation_code` varchar(255) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `users_perm_temp`
--

CREATE TABLE IF NOT EXISTS `users_perm_temp` (
  `users_permisson_tempid` int(11) NOT NULL AUTO_INCREMENT,
  `fk_userid` int(11) DEFAULT NULL,
  `fk_resourceid` int(11) DEFAULT NULL,
  `fk_email_login` varchar(255) DEFAULT NULL,
  `perm_type` varchar(255) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`users_permisson_tempid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `user_resource`
--

CREATE TABLE IF NOT EXISTS `user_resource` (
  `user_resourceid` int(11) NOT NULL AUTO_INCREMENT,
  `fk_userid` int(11) DEFAULT NULL,
  `fk_resourceid` int(11) DEFAULT NULL,
  `perm_type` varchar(20) DEFAULT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `userid_created` int(11) DEFAULT '0',
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `userid_updated` int(11) DEFAULT '0',
  `rec_status` int(1) DEFAULT '1',
  PRIMARY KEY (`user_resourceid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Edit Permission -> can_edit and View Permission -> can_view' AUTO_INCREMENT=1 ;

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