use EventStore;

CREATE TABLE `authDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `batchDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `companyDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `emailDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `kpiDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `questionDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `subscriptionDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;

CREATE TABLE `userDomainEventEntry` (
  `globalIndex` bigint(20) NOT NULL AUTO_INCREMENT,
  `aggregateIdentifier` varchar(255) NOT NULL,
  `sequenceNumber` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `eventIdentifier` varchar(255) NOT NULL,
  `metaData` blob,
  `payload` blob NOT NULL,
  `payloadRevision` varchar(255) DEFAULT NULL,
  `payloadType` varchar(255) NOT NULL,
  `timeStamp` varchar(255) NOT NULL,
  PRIMARY KEY (`globalIndex`),
  UNIQUE KEY `aggregateIdentifier` (`aggregateIdentifier`,`sequenceNumber`),
  UNIQUE KEY `eventIdentifier` (`eventIdentifier`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;