-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 17, 2011 at 01:26 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!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: `dhis_test`
--

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

--
-- Table structure for table `minmaxdataelement`
--

CREATE TABLE IF NOT EXISTS `minmaxdataelement` (
  `minmaxdataelementid` int(11) NOT NULL,
  `sourceid` int(11) NOT NULL,
  `dataelementid` int(11) NOT NULL,
  `categoryoptioncomboid` int(11) NOT NULL,
  `minvalue` int(11) NOT NULL,
  `maxvalue` int(11) NOT NULL,
  `generated` tinyint(1) NOT NULL,
  PRIMARY KEY (`minmaxdataelementid`),
  KEY `fk_minmaxdataelement_categoryoptioncomboid` (`categoryoptioncomboid`),
  KEY `fk_minmaxdataelement_dataelementid` (`dataelementid`),
  KEY `fk_minmaxdataelement_organisationunitid` (`sourceid`),
  KEY `index_minmaxdataelement` (`sourceid`,`dataelementid`,`categoryoptioncomboid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `minmaxdataelement`
--


--
-- Constraints for dumped tables
--

--
-- Constraints for table `minmaxdataelement`
--
ALTER TABLE `minmaxdataelement`
  ADD CONSTRAINT `fk_minmaxdataelement_categoryoptioncomboid` FOREIGN KEY (`categoryoptioncomboid`) REFERENCES `categoryoptioncombo` (`categoryoptioncomboid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_minmaxdataelement_dataelementid` FOREIGN KEY (`dataelementid`) REFERENCES `dataelement` (`dataelementid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_minmaxdataelement_organisationunitid` FOREIGN KEY (`sourceid`) REFERENCES `organisationunit` (`organisationunitid`) ON DELETE NO ACTION ON UPDATE NO ACTION;
