-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jan 30, 2020 at 06:05 AM
-- Server version: 5.6.27
-- PHP Version: 5.5.30

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

--
-- Database: `logging`
--

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

--
-- Table structure for table `FN`
--

CREATE TABLE IF NOT EXISTS `FN` (
  `Sequence` varchar(15) NOT NULL DEFAULT '0',
  `Subject` varchar(25) DEFAULT NULL,
  `OID` int(2) NOT NULL DEFAULT '0',
  `OExpr` varchar(700) DEFAULT NULL,
  `File path` varchar(63) DEFAULT NULL,
  `Before` varchar(4) DEFAULT NULL,
  `After` varchar(4) DEFAULT NULL,
  PRIMARY KEY (`Sequence`,`OID`),
  KEY `Subject` (`Subject`),
  KEY `OID` (`OID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `FP`
--

CREATE TABLE IF NOT EXISTS `FP` (
  `Sequence` varchar(15) NOT NULL DEFAULT '',
  `Subject` varchar(25) DEFAULT NULL,
  `TID` int(3) NOT NULL DEFAULT '0',
  `TExpr` varchar(700) DEFAULT NULL,
  `FQN` varchar(200) DEFAULT NULL,
  `Before` varchar(7) DEFAULT NULL,
  `After` varchar(6) DEFAULT NULL,
  PRIMARY KEY (`Sequence`,`TID`),
  KEY `Subject` (`Subject`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `oracle_log_changes`
--

CREATE TABLE IF NOT EXISTS `oracle_log_changes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `repo_name` varchar(20) NOT NULL,
  `sha1_change` text NOT NULL,
  `original_expr` text NOT NULL,
  `relative_file_name` text NOT NULL,
  `old_level` varchar(15) NOT NULL,
  `new_level` varchar(15) NOT NULL,
  `date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repo_name_fk_idx` (`repo_name`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `oracle_log_changes`
--

INSERT INTO `oracle_log_changes` (`id`, `repo_name`, `sha1_change`, `original_expr`, `relative_file_name`, `old_level`, `new_level`, `date`) VALUES
(1, 'guava', 'acca567031e047e14f965de4bfa3e2c0f80d43b6', 'logger.info("Service " + service + " has terminated. Previous state was " + from + " state.");', 'guava/src/com/google/common/util/concurrent/ServiceManager.java', 'INFO', 'FINE', '2013-02-07 10:20:28'),
(2, 'guava', 'acca567031e047e14f965de4bfa3e2c0f80d43b6', 'logger.log(Level.INFO,"Started " + service + " in " + startupTimeMillis() + " ms.");', 'guava/src/com/google/common/util/concurrent/ServiceManager.java', 'INFO', 'FINE', '2013-02-07 10:20:28'),
(3, 'guava', 'acca567031e047e14f965de4bfa3e2c0f80d43b6', 'logger.log(Level.INFO,"Starting {0}", service);', 'guava/src/com/google/common/util/concurrent/ServiceManager.java', 'INFO', 'FINE', '2013-02-07 10:20:28'),
(4, 'WALA', 'e37d67c7d2ec599571989801e7241dbb7a54984a', 'logger.fine("spawning process " + cmd);', 'com.ibm.wala.util/src/com/ibm/wala/util/processes/Launcher.java', 'FINE', 'INFO', '2012-08-21 10:49:33'),
(6, 'IRCT-API', 'ed750af872a05bf19da438e5c3442db452a9ba8c', 'log.info("Unable to search for term on resource " + resource + " message: " + e.getMessage());', 'src/main/java/edu/harvard/hms/dbmi/bd2k/irct/controller/PathController.java', 'INFO', 'SEVERE', '2017-07-17 10:52:09'),
(7, 'junit5', 'e8b453534dbaa263ec0a7bc911886d07bf47c9f8', 'LOG.severe(() -> "ClassLoader: " + classLoader);', 'junit-commons/src/main/java/org/junit/gen5/commons/util/ClasspathScanner.java', 'SEVERE', 'FINE', '2015-11-14 16:05:45'),
(8, 'junit5', 'c7084e404c49fa414efc55909471bfd70b215880', 'logger.warning(String.format("Class %s was excluded by a class filter: %s", testClass.getName(),', 'junit4-engine/src/main/java/org/junit/gen5/engine/junit4/discovery/JUnit4DiscoveryRequestResolver.java', 'WARNING', 'INFO', '2016-01-24 20:27:17'),
(9, 'junit5', 'e56e599dd88002bf19de2514728485db0eacc99d', 'LOG.warning(() -> {String classDescription = clazz.getName();  return format("Class ''%s'' is not a test container", classDescription);});', 'junit5-engine/src/main/java/org/junit/gen5/engine/junit5/discoveryNEW/TestContainerResolver.java', 'WARNING', 'INFO', '2016-03-17 12:43:56'),
(10, 'junit5', '5fd0fedba3fe51466ad8278395c1bddbeb340142', 'LOG.info(() -> {String classDescription = testClass.getName(); return format("Class ''%s'' could not be resolved", classDescription);});', 'junit5-engine/src/main/java/org/junit/gen5/engine/junit5/discoveryNEW/DiscoverySelectorResolver.java', 'INFO', 'WARNING', '2016-03-17 16:32:27'),
(11, 'junit5', '5fd0fedba3fe51466ad8278395c1bddbeb340142', 'LOG.info(() -> {String methodDescription = testMethod.getDeclaringClass().getName() + "#" + testMethod.getName(); return format("Method ''%s'' could not be resolved", methodDescription);});', 'junit5-engine/src/main/java/org/junit/gen5/engine/junit5/discoveryNEW/DiscoverySelectorResolver.java', 'INFO', 'WARNING', '2016-03-17 16:32:27'),
(12, 'junit5', '6bf76b6409bbd89a85e5f6631baab6b3e26a19ff', 'LOG.warning(() -> {String classDescription = clazz.getName(); return format("Class ''%s'' is not a test container", classDescription);});', 'junit5-engine/src/main/java/org/junit/gen5/engine/junit5/discoveryNEW/TestContainerResolver.java', 'WARNING', 'INFO', '2016-03-17 12:43:56'),
(13, 'junit5', '86610b095e7b38469bd5d51dd9807e6bb78e0bf6', 'LOG.info(() -> {String classDescription = testClass.getName(); return format("Class ''%s'' could not be resolved", classDescription);});', 'junit5-engine/src/main/java/org/junit/gen5/engine/junit5/discoveryNEW/DiscoverySelectorResolver.java', 'INFO', 'WARNING', '2016-03-17 16:32:27'),
(14, 'junit5', '86610b095e7b38469bd5d51dd9807e6bb78e0bf6', 'LOG.info(() -> { String methodDescription = testMethod.getDeclaringClass().getName() + "#" + testMethod.getName(); return format("Method ''%s'' could not be resolved", methodDescription);});', 'junit5-engine/src/main/java/org/junit/gen5/engine/junit5/discoveryNEW/DiscoverySelectorResolver.java', 'INFO', 'WARNING', '2016-03-17 16:32:27'),
(15, 'junit5', 'dff02c3f3ce060307863c3730ebe17b7d9149d0c', '(testClass, reason) -> logger.info(() -> String.format("Class %s was excluded by a class filter: %s",testClass.getName(), reason.orElse("<unknown reason>"))));return collector.toRequests(classFilter.toPredicate());}', 'junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/JUnit4DiscoveryRequestResolver.java', 'INFO', 'FINE', '2016-07-25 22:00:25'),
(16, 'junit5', 'ddcfb41b0f824cdbaae7cf868d3491e555ced4f6', 'LOG.info(() -> createDiscoveredTestEnginesMessage(testEngines));', 'junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java', 'INFO', 'CONFIG', '2017-02-24 22:31:34'),
(17, 'junit5', 'de150913cf2a7df3299a23bdc06636e1475400a1', 'logger.warning(() -> String.format("Class %s could not be resolved", testClass.getName()));', 'junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/JUnit4DiscoveryRequestResolver.java', 'WARNING', 'INFO', '2017-01-21 21:03:43'),
(18, 'spotbugs', 'fb02ef26d3fecb3e97418a37b2da503982e34f30', 'LOGGER.warning("Found: " + found + ", missing: " + (hashes.size()-found));', 'sandbox/cloudServlet/src/java/edu/umd/cs/findbugs/flybush/QueryServlet.java', 'WARNING', 'INFO', '2010-03-16 18:30:18'),
(19, 'spotbugs', 'fb02ef26d3fecb3e97418a37b2da503982e34f30', 'LOGGER.warning("Looking up hashes took " + (System.currentTimeMillis() - start) + "ms");', 'sandbox/cloudServlet/src/java/edu/umd/cs/findbugs/flybush/UpdateServlet.java', 'WARNING', 'INFO', '2010-03-16 18:30:18'),
(20, 'spotbugs', 'fb02ef26d3fecb3e97418a37b2da503982e34f30', 'LOGGER.warning("Committed new issue in " + (System.currentTimeMillis() - start) + "ms");', 'sandbox/cloudServlet/src/java/edu/umd/cs/findbugs/flybush/UpdateServlet.java', 'WARNING', 'INFO', '2010-03-16 18:30:18'),
(21, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Initializing " + getClass().getSimpleName());', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudClient.java', 'INFO', 'FINE', '2010-04-20 21:27:28'),
(22, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Updating timestamps for " + bugs.size() + " bugs in " + builder.getIssueGroupsCount() + " groups");', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudNetworkClient.java', 'INFO', 'FINER', '2010-04-20 21:27:28'),
(23, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Checking " + bugsByHash.size() + " bugs against App Engine Cloud");', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudNetworkClient.java', 'INFO', 'FINER', '2010-04-20 21:27:28'),
(24, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Connected in " + (System.currentTimeMillis() - start) + "ms");', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudNetworkClient.java', 'INFO', 'FINER', '2010-04-20 21:27:28'),
(25, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Submitted hashes (" + hashList.getSerializedSize() / 1024 + " KB) in " + elapsed + "ms ("', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudNetworkClient.java', 'INFO', 'FINER', '2010-04-20 21:27:28'),
(26, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Received " + foundIssues + " bugs from server in " + elapsed + "ms ("', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudNetworkClient.java', 'INFO', 'FINE', '2010-04-20 21:27:28'),
(27, 'spotbugs', '2fa4fe0aa47c23cad9bf84fa8b48d7aa4eb4d74b', 'LOGGER.info("Uploading " + bugsToSend.size() + " bugs to App Engine Cloud");', 'sandbox/appEngineCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/AppEngineCloudNetworkClient.java', 'INFO', 'FINER', '2010-04-20 21:27:28'),
(28, 'spotbugs', '6014c26cc0f481c7503649c9477927d53c2fe774', 'LOGGER.log(Level.SEVERE, "Error during periodic evaluation check", e);', 'plugins/webCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/WebCloudClient.java', 'SEVERE', 'WARNING', '2010-11-30 22:38:54'),
(29, 'spotbugs', '087b57a17c20d0aee1c25e93dc0b8e97580e3eed', 'LOGGER.log(Level.WARNING, msg, e);', 'findbugs/src/java/edu/umd/cs/findbugs/UsageTracker.java', 'WARNING', 'INFO', '2011-07-29 18:11:23'),
(30, 'spotbugs', 'e36a38b832b4c5b4c80690b9ef60e1160358bad0', 'LOGGER.log(Level.SEVERE, "Could not sign out", e);', 'plugins/webCloudClient/src/java/edu/umd/cs/findbugs/cloud/appEngine/WebCloudNetworkClient.java', 'SEVERE', 'INFO', '2011-10-25 00:41:04'),
(31, 'spotbugs', 'a1ff91a4f289fb15161aa66d7d547828ae4840b5', 'LOGGER.warning("Consolidating " + dateStr);', 'server/common/src/java/edu/umd/cs/findbugs/flybush/UsageConsolidatorServlet.java', 'WARNING', 'INFO', '2012-01-25 22:44:58'),
(32, 'spotbugs', 'a1ff91a4f289fb15161aa66d7d547828ae4840b5', 'LOGGER.warning(msg);', 'server/common/src/java/edu/umd/cs/findbugs/flybush/UsageConsolidatorServlet.java', 'WARNING', 'INFO', '2012-01-25 22:44:58'),
(33, 'spotbugs', 'a1ff91a4f289fb15161aa66d7d547828ae4840b5', 'LOGGER.warning("About to execute query");', 'server/common/src/java/edu/umd/cs/findbugs/flybush/UsageConsolidatorServlet.java', 'WARNING', 'INFO', '2012-01-25 22:44:58');


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

--
-- Table structure for table `oracle_subjects`
--

CREATE TABLE IF NOT EXISTS `oracle_subjects` (
  `name` varchar(20) NOT NULL,
  `url` text NOT NULL,
  `sha1_head` text NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `oracle_subjects`
--

INSERT INTO `oracle_subjects` (`name`, `url`, `sha1_head`) VALUES
('binnavi', 'https://github.com/google/binnavi', '8e0aef41402db6c6ecb2a26bb943bbbc5fd989b2'),
('blueocean-plugin', 'https://github.com/jenkinsci/blueocean-plugin', 'de8b8ca3b020f8cc8d43ef0ddd058b3df99eb5fc'),
('che', 'https://github.com/eclipse/che', '07a0bab27dd2be247a243d9ffa241a7cddb1e3ac'),
('ElasticSearch', 'https://github.com/elastic/elasticsearch.git', 'd07e61b187233787190fd860025a39a1eaf071a1'),
('findbugs', 'https://github.com/findbugsproject/findbugs', '451c28097c22ef8e6f8943e5ebe6a16ff41beff7'),
('guava', 'https://github.com/google/guava.git', '838560034dfaa1afdf51a126afe6b8b8e6cce3dd'),
('IRCT-API', 'https://github.com/hms-dbmi/IRCT-API.git', 'aa0f039f454834e78affc94e159bb76a1ffefed1'),
('Java-Design-Patterns', 'https://github.com/iluwatar/java-design-patterns.git', 'b6b4602baf5a12d8b76b3f8dd0284bae44230aa9'),
('jetty.project', 'https://github.com/eclipse/jetty.project', '009a4659a75c81010ccbca58419993c30871e18d'),
('jgit', 'https://github.com/eclipse/jgit', '59e75961603f649e6e9d4118f8540e629981e90d'),
('jOOQ', 'https://github.com/jOOQ/jOOQ', 'ffc95955e9a49132817c5cc3230f52ac13f858b2'),
('jsilhouette', 'https://github.com/aalmiray/jsilhouette', 'be37202e6084357b8b0b5b7a6f7a67e10a986990'),
('junit5', 'https://github.com/junit-team/junit5.git', 'c7c579633b8b1e61a4551f1c0530fe10999e7ac4'),
('qbit', 'https://github.com/advantageous/qbit', '533b3671785f238d576b02b5290c6525ed60f583'),
('ReactionDecoder', 'https://github.com/asad/ReactionDecoder.git', '032d919519eeb30153354020ea736cb18a6a7642'),
('spotbugs', '''https://github.com/spotbugs/spotbugs.git', '190e1e1c877b834bb59e6001096f749e821c574b'),
('WALA', 'https://github.com/wala/WALA.git', '7f68e765be200f1eb8bc876d50a83aff797485e4');


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

--
-- Table structure for table `runs`
--

CREATE TABLE IF NOT EXISTS `runs` (
  `sequence` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`sequence`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


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

--
-- Table structure for table `tool_log_changes`
--

CREATE TABLE IF NOT EXISTS `tool_log_changes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sequence` varchar(15) NOT NULL,
  `raw_subject` varchar(45) DEFAULT NULL,
  `old_level` varchar(10) NOT NULL,
  `new_level` varchar(10) NOT NULL,
  `log_expr` varchar(700) NOT NULL,
  `fqn` varchar(200) NOT NULL,
  `start_pos` int(11) NOT NULL,
  `action` varchar(20) NOT NULL,
  `doi_val` float NOT NULL,
  `enclosing_method` varchar(500) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `raw_subj_fkey_idx` (`raw_subject`),
  KEY `sequence` (`sequence`),
  KEY `log_expr` (`log_expr`),
  KEY `fqn` (`fqn`)
) ENGINE=InnoDB AUTO_INCREMENT=2114 DEFAULT CHARSET=utf8;


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

--
-- Table structure for table `tool_repos`
--

CREATE TABLE IF NOT EXISTS `tool_repos` (
  `sequence` varchar(15) NOT NULL DEFAULT '',
  `repo URL` varchar(60) DEFAULT NULL,
  `SHA-1 of head` varchar(40) DEFAULT NULL,
  `N for commits` int(4) DEFAULT NULL,
  `number of commits processed` int(4) DEFAULT NULL,
  `actual number of commits` int(4) DEFAULT NULL,
  `average Java lines added` double(18,3) DEFAULT NULL,
  `average Java lines removed` double(17,3) DEFAULT NULL,
  PRIMARY KEY (`sequence`),
  KEY `repo URL` (`repo URL`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tool_results`
--

CREATE TABLE IF NOT EXISTS `tool_results` (
  `sequence` varchar(15) NOT NULL DEFAULT '',
  `subject` varchar(45) NOT NULL DEFAULT '',
  `repo URL` varchar(60) NOT NULL DEFAULT '',
  `input logging statements` int(3) DEFAULT NULL,
  `candidate logging statements` int(3) DEFAULT NULL,
  `passing logging statements` int(3) DEFAULT NULL,
  `failures` int(1) DEFAULT NULL,
  `transformed logging statements` int(3) DEFAULT NULL,
  `log level not lowered in catch blocks` int(2) DEFAULT NULL,
  `log level not lowered in if statements` int(2) DEFAULT NULL,
  `log level not transformed due to if condition` int(2) DEFAULT NULL,
  `log level not lowered due to keywords` int(2) DEFAULT NULL,
  `use log category (SEVERE/WARNING/CONFIG)` tinyint(1) DEFAULT NULL,
  `use log category (CONFIG)` tinyint(1) DEFAULT NULL,
  `not lower log levels of logs inside of catch blocks` tinyint(1) DEFAULT NULL,
  `not lower log levels of logs inside of if statements` tinyint(1) DEFAULT NULL,
  `not lower log levels in their messages with keywords` tinyint(1) DEFAULT NULL,
  `consider if condition having log level` tinyint(1) DEFAULT NULL,
  `time (s)` decimal(6,3) DEFAULT NULL,
  PRIMARY KEY (`sequence`,`subject`,`repo URL`),
  KEY `subject` (`subject`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tool_results`
--


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

--
-- Table structure for table `TP`
--

CREATE TABLE IF NOT EXISTS `TP` (
  `Sequence` varchar(15) DEFAULT NULL,
  `Subject` varchar(25) DEFAULT NULL,
  `TID` int(3) NOT NULL DEFAULT '0',
  `OID` int(2) DEFAULT NULL,
  `TExpr` varchar(700) DEFAULT NULL,
  `OExpr` varchar(700) DEFAULT NULL,
  `File path` varchar(63) DEFAULT NULL,
  `FQN` varchar(200) DEFAULT NULL,
  `Before` varchar(4) DEFAULT NULL,
  `TAfter` varchar(6) DEFAULT NULL,
  `OAfter` varchar(4) DEFAULT NULL,
  `Distance` int(1) DEFAULT NULL,
  `Distance ratio` double NOT NULL,
  PRIMARY KEY (`TID`),
  KEY `Sequence` (`Sequence`),
  KEY `Subject` (`Subject`),
  KEY `OID` (`OID`),
  KEY `File path` (`File path`),
  KEY `FQN` (`FQN`),
  KEY `Before` (`Before`),
  KEY `TAfter` (`TAfter`),
  KEY `OAfter` (`OAfter`),
  KEY `TExpr` (`TExpr`(255)),
  KEY `OExpr` (`OExpr`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `working_sets`
--

CREATE TABLE IF NOT EXISTS `working_sets` (
  `subject_raw` varchar(45) NOT NULL DEFAULT '',
  `subject` varchar(25) NOT NULL,
  PRIMARY KEY (`subject_raw`,`subject`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


--
-- Constraints for table `FN`
--
ALTER TABLE `FN`
  ADD CONSTRAINT `fn_ibfk_1` FOREIGN KEY (`Sequence`) REFERENCES `tool_log_changes` (`sequence`),
  ADD CONSTRAINT `fn_ibfk_2` FOREIGN KEY (`Subject`) REFERENCES `oracle_subjects` (`name`),
  ADD CONSTRAINT `fn_ibfk_3` FOREIGN KEY (`OID`) REFERENCES `oracle_log_changes` (`id`);

--
-- Constraints for table `FP`
--
ALTER TABLE `FP`
  ADD CONSTRAINT `fp_ibfk_1` FOREIGN KEY (`Sequence`,`TID`) REFERENCES `tool_log_changes` (`sequence`, `id`),
  ADD CONSTRAINT `fp_ibfk_2` FOREIGN KEY (`Subject`) REFERENCES `oracle_subjects` (`name`);

--
-- Constraints for table `oracle_log_changes`
--
ALTER TABLE `oracle_log_changes`
  ADD CONSTRAINT `repo_name_fk` FOREIGN KEY (`repo_name`) REFERENCES `oracle_subjects` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tool_log_changes`
--
ALTER TABLE `tool_log_changes`
  ADD CONSTRAINT `raw_subj_fkey` FOREIGN KEY (`raw_subject`) REFERENCES `working_sets` (`subject_raw`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tool_log_changes_ibfk_1` FOREIGN KEY (`sequence`) REFERENCES `tool_repos` (`sequence`);

--
-- Constraints for table `tool_results`
--
ALTER TABLE `tool_results`
  ADD CONSTRAINT `tool_results_ibfk_1` FOREIGN KEY (`subject`) REFERENCES `working_sets` (`subject_raw`),
  ADD CONSTRAINT `tool_results_ibfk_2` FOREIGN KEY (`sequence`) REFERENCES `tool_repos` (`sequence`);

--
-- Constraints for table `TP`
--
ALTER TABLE `TP`
  ADD CONSTRAINT `tp_ibfk_1` FOREIGN KEY (`TID`) REFERENCES `tool_log_changes` (`id`),
  ADD CONSTRAINT `tp_ibfk_3` FOREIGN KEY (`Subject`) REFERENCES `oracle_subjects` (`name`),
  ADD CONSTRAINT `tp_ibfk_4` FOREIGN KEY (`OID`) REFERENCES `oracle_log_changes` (`id`),
  ADD CONSTRAINT `tp_ibfk_5` FOREIGN KEY (`Sequence`) REFERENCES `tool_log_changes` (`sequence`);

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