drop database if exists provman; create database provman; create user guest identified by 'guest'; grant all privileges on provman.* to guest@'localhost'; USE provman; SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `provman` -- -- -------------------------------------------------------- -- delimiter $$ CREATE TABLE `activity` ( `ActivityKey` bigint(20) NOT NULL AUTO_INCREMENT, `ActivityId` varchar(255) DEFAULT NULL, `StartTime` datetime DEFAULT NULL, `EndTime` datetime DEFAULT NULL, `Status` varchar(255) DEFAULT NULL, `DocumentKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`ActivityKey`), KEY `FKA126572FEB67100D` (`DocumentKey`), CONSTRAINT `FKA126572FEB67100D` FOREIGN KEY (`DocumentKey`) REFERENCES `document` (`DocumentKey`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `activityattributes` ( `AttributesId` bigint(20) NOT NULL AUTO_INCREMENT, `AttributesKey` varchar(255) DEFAULT NULL, `AttributesValue` varchar(255) DEFAULT NULL, `ActivityKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`AttributesId`), KEY `FK8761EDE6765B8D` (`ActivityKey`), CONSTRAINT `FK8761EDE6765B8D` FOREIGN KEY (`ActivityKey`) REFERENCES `activity` (`ActivityKey`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `agent` ( `AgentKey` bigint(20) NOT NULL AUTO_INCREMENT, `AgentId` varchar(255) DEFAULT NULL, `DocumentKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`AgentKey`), KEY `FK3C452E5EB67100D` (`DocumentKey`), CONSTRAINT `FK3C452E5EB67100D` FOREIGN KEY (`DocumentKey`) REFERENCES `document` (`DocumentKey`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `agentattributes` ( `AttributesId` bigint(20) NOT NULL AUTO_INCREMENT, `AttributesKey` varchar(255) DEFAULT NULL, `AttributesValue` varchar(255) DEFAULT NULL, `AgentKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`AttributesId`), KEY `FK1F993E1CD4BA9371` (`AgentKey`), CONSTRAINT `FK1F993E1CD4BA9371` FOREIGN KEY (`AgentKey`) REFERENCES `agent` (`AgentKey`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `document` ( `DocumentKey` bigint(20) NOT NULL AUTO_INCREMENT, `DocumentId` varchar(255) DEFAULT NULL, PRIMARY KEY (`DocumentKey`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `documentattributes` ( `AttributesId` bigint(20) NOT NULL AUTO_INCREMENT, `AttributesKey` varchar(255) DEFAULT NULL, `AttributesValue` varchar(255) DEFAULT NULL, `DocumentKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`AttributesId`), KEY `FK172DACF2EB67100D` (`DocumentKey`), CONSTRAINT `FK172DACF2EB67100D` FOREIGN KEY (`DocumentKey`) REFERENCES `document` (`DocumentKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `entity` ( `EntityKey` bigint(20) NOT NULL AUTO_INCREMENT, `EntityId` varchar(255) DEFAULT NULL, `EntityValue` varchar(1024) DEFAULT NULL, `DocumentKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`EntityKey`), KEY `FK7C02D003EB67100D` (`DocumentKey`), CONSTRAINT `FK7C02D003EB67100D` FOREIGN KEY (`DocumentKey`) REFERENCES `document` (`DocumentKey`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `entityattributes` ( `AttributesId` bigint(20) NOT NULL AUTO_INCREMENT, `AttributesKey` varchar(255) DEFAULT NULL, `AttributesValue` varchar(255) DEFAULT NULL, `EntityKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`AttributesId`), KEY `FK6C6DBA30A468D` (`EntityKey`), CONSTRAINT `FK6C6DBA30A468D` FOREIGN KEY (`EntityKey`) REFERENCES `entity` (`EntityKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `relation` ( `RelationKey` bigint(20) NOT NULL AUTO_INCREMENT, `RelationType` varchar(255) NOT NULL, `RelationId` varchar(255) DEFAULT NULL, `Time` datetime DEFAULT NULL, `Influencer` bigint(20) DEFAULT NULL, `Influencee` bigint(20) DEFAULT NULL, `Activity` bigint(20) DEFAULT NULL, `Used` bigint(20) DEFAULT NULL, `Generation` bigint(20) DEFAULT NULL, `Entity` bigint(20) DEFAULT NULL, `DocumentKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`RelationKey`), KEY `Entity` (`Entity`), KEY `FKE2CE5E1CEB67100D` (`DocumentKey`), KEY `Influencee` (`Influencee`), KEY `Influencee_2` (`Influencee`), KEY `Influencee_3` (`Influencee`), KEY `Influencer` (`Influencer`), KEY `Used` (`Used`), KEY `Influencer_2` (`Influencer`), KEY `Influencer_3` (`Influencer`), KEY `Activity` (`Activity`), KEY `Generation` (`Generation`), CONSTRAINT `FKE2CE5E1CEB67100D` FOREIGN KEY (`DocumentKey`) REFERENCES `document` (`DocumentKey`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8$$ delimiter $$ CREATE TABLE `relationattributes` ( `AttributesId` bigint(20) NOT NULL AUTO_INCREMENT, `AttributesKey` varchar(255) DEFAULT NULL, `AttributesValue` varchar(255) DEFAULT NULL, `RelationKey` bigint(20) DEFAULT NULL, PRIMARY KEY (`AttributesId`), KEY `FKAF3F093C29C586D` (`RelationKey`), CONSTRAINT `FKAF3F093C29C586D` FOREIGN KEY (`RelationKey`) REFERENCES `relation` (`RelationKey`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8$$