text: -- MySQL dump 10.13  Distrib 5.1.63, for apple-darwin12.0.0 (i386)
  --
  -- Host: val-db    Database: sage
  -- ------------------------------------------------------
  -- Server version	5.5.16-enterprise-commercial-advanced-log
  
  /*!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 */;
  /*!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' */;
  /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  
  --
  -- Table structure for table `cv`
  --
  
  DROP TABLE IF EXISTS `cv`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `cv` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `definition` varchar(500) DEFAULT NULL,
    `version` tinyint(3) unsigned NOT NULL,
    `is_current` tinyint(3) unsigned NOT NULL,
    `display_name` varchar(255) DEFAULT NULL,
    `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `cv_name_uk_ind` (`name`) USING BTREE,
    KEY `cv_definition_ind` (`definition`)
  ) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `cv_term`
  --
  
  DROP TABLE IF EXISTS `cv_term`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `cv_term` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `cv_id` int(10) unsigned NOT NULL,
    `name` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
    `definition` varchar(500) DEFAULT NULL,
    `is_current` tinyint(3) unsigned NOT NULL,
    `display_name` varchar(255) DEFAULT NULL,
    `data_type` varchar(255) DEFAULT NULL,
    `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `cv_term_name_uk_ind` (`cv_id`,`name`) USING BTREE,
    KEY `cv_term_cv_id_fk_ind` (`cv_id`) USING BTREE,
    CONSTRAINT `cv_term_cv_id_fk` FOREIGN KEY (`cv_id`) REFERENCES `cv` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=6069 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `cv_relationship`
  --
  
  DROP TABLE IF EXISTS `cv_relationship`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `cv_relationship` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `type_id` int(10) unsigned NOT NULL,
    `subject_id` int(10) unsigned NOT NULL,
    `object_id` int(10) unsigned NOT NULL,
    `is_current` tinyint(3) unsigned NOT NULL,
    `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `cv_relationship_uk_ind` (`type_id`,`subject_id`,`object_id`) USING BTREE,
    KEY `cv_relationship_type_id_fk_ind` (`type_id`) USING BTREE,
    KEY `cv_relationship_subject_id_fk_ind` (`subject_id`) USING BTREE,
    KEY `cv_relationship_object_id_fk_ind` (`object_id`) USING BTREE,
    CONSTRAINT `cv_relationship_object_id_fk` FOREIGN KEY (`object_id`) REFERENCES `cv` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `cv_relationship_subject_id_fk` FOREIGN KEY (`subject_id`) REFERENCES `cv` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `cv_relationship_type_id_fk` FOREIGN KEY (`type_id`) REFERENCES `cv_term` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `cv_term_relationship`
  --
  
  DROP TABLE IF EXISTS `cv_term_relationship`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `cv_term_relationship` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `type_id` int(10) unsigned NOT NULL,
    `subject_id` int(10) unsigned NOT NULL,
    `object_id` int(10) unsigned NOT NULL,
    `is_current` tinyint(3) unsigned NOT NULL,
    `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    UNIQUE KEY `cv_term_relationship_uk_ind` (`type_id`,`subject_id`,`object_id`) USING BTREE,
    KEY `cv_term_relationship_type_id_fk_ind` (`type_id`) USING BTREE,
    KEY `cv_term_relationship_subject_id_fk_ind` (`subject_id`) USING BTREE,
    KEY `cv_term_relationship_object_id_fk_ind` (`object_id`) USING BTREE,
    CONSTRAINT `cv_term_relationship_object_id_fk` FOREIGN KEY (`object_id`) REFERENCES `cv_term` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `cv_term_relationship_subject_id_fk` FOREIGN KEY (`subject_id`) REFERENCES `cv_term` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `cv_term_relationship_type_id_fk` FOREIGN KEY (`type_id`) REFERENCES `cv_term` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=4036 DEFAULT CHARSET=latin1;
  /*!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 2013-12-17 10:30:04
  