/*
SQLyog Community v8.4 Beta1
MySQL - 5.1.48-community : Database - smbbe
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`smbbe` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `smbbe`;

/*Table structure for table `exactmatch` */

DROP TABLE IF EXISTS `exactmatch`;

CREATE TABLE `exactmatch` (
  `sysCode` int(11) NOT NULL,
  `candidateSchemaID` bigint(20) NOT NULL,
  `candidateTermID` bigint(20) NOT NULL,
  `targetSchemaID` bigint(20) NOT NULL,
  `targetTermID` bigint(20) NOT NULL,
  PRIMARY KEY (`sysCode`,`candidateSchemaID`,`candidateTermID`,`targetSchemaID`,`targetTermID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `mapping` */

DROP TABLE IF EXISTS `mapping`;

CREATE TABLE `mapping` (
  `sysCode` int(11) NOT NULL,
  `candidateSchemaID` bigint(20) NOT NULL,
  `candidateTermID` bigint(20) NOT NULL,
  `targetSchemaID` bigint(20) NOT NULL,
  `targetTermID` bigint(20) NOT NULL,
  `MatcherID` bigint(11) NOT NULL,
  PRIMARY KEY (`sysCode`,`candidateSchemaID`,`candidateTermID`,`targetSchemaID`,`targetTermID`,`MatcherID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `matchers` */

DROP TABLE IF EXISTS `matchers`;

CREATE TABLE `matchers` (
  `MatcherID` bigint(20) NOT NULL,
  `MatcherName` varchar(50) NOT NULL,
  `MatcherDesc` varchar(500) DEFAULT NULL,
  `sysCode` int(10) NOT NULL,
  PRIMARY KEY (`MatcherID`,`sysCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `matcherweights` */

DROP TABLE IF EXISTS `matcherweights`;

CREATE TABLE `matcherweights` (
  `mID` bigint(20) NOT NULL,
  `sysCode` int(11) NOT NULL,
  `classCode` int(11) NOT NULL,
  `weight` double DEFAULT NULL,
  PRIMARY KEY (`mID`,`sysCode`,`classCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `schemapairs` */

DROP TABLE IF EXISTS `schemapairs`;

CREATE TABLE `schemapairs` (
  `sysCode` int(11) NOT NULL,
  `candidateSchemaID` bigint(20) NOT NULL,
  `targetSchemaID` bigint(20) NOT NULL,
  `classCode` int(11) DEFAULT NULL,
  PRIMARY KEY (`sysCode`,`candidateSchemaID`,`targetSchemaID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `schemata` */

DROP TABLE IF EXISTS `schemata`;

CREATE TABLE `schemata` (
  `sysCode` int(11) NOT NULL,
  `SchemaID` bigint(20) NOT NULL,
  `SchemaName` varchar(200) NOT NULL,
  `Source` int(11) DEFAULT NULL,
  `Lang` int(11) DEFAULT NULL,
  `isReal` int(11) DEFAULT NULL,
  `OriginalML` int(11) DEFAULT NULL,
  `MaxHeight` int(11) DEFAULT NULL,
  `SubclassRels` int(11) DEFAULT NULL,
  `Instances` int(11) DEFAULT NULL,
  `AssocRels` int(11) DEFAULT NULL,
  `Atts` int(11) DEFAULT NULL,
  `Classes` int(11) DEFAULT NULL,
  `VisibleItems` int(11) DEFAULT NULL,
  PRIMARY KEY (`sysCode`,`SchemaID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `systems` */

DROP TABLE IF EXISTS `systems`;

CREATE TABLE `systems` (
  `sysCode` int(11) NOT NULL,
  `sysName` varchar(20) NOT NULL,
  PRIMARY KEY (`sysCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `terms` */

DROP TABLE IF EXISTS `terms`;

CREATE TABLE `terms` (
  `sysCode` int(11) NOT NULL,
  `SchemaID` bigint(20) NOT NULL,
  `Tid` bigint(20) NOT NULL,
  `TName` varchar(1000) DEFAULT NULL,
  `TType` bigint(20) DEFAULT NULL,
  `KnownComposite` int(10) unsigned zerofill DEFAULT NULL,
  `KnownPartial` int(10) unsigned zerofill DEFAULT NULL,
  PRIMARY KEY (`sysCode`,`SchemaID`,`Tid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
