From 156515700c098c13feddcee20fb9299fb966cf70 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Fri, 21 Jul 2023 18:05:03 +0800 Subject: [PATCH] add: datatypes --- datatypes/es/client.json | 26 +++++ datatypes/es/non-choice-questions.json | 38 +++++++ datatypes/es/question-subscription.json | 83 +++++++++++++++ datatypes/es/question-tags.json | 18 ++++ datatypes/es/question-topics.json | 17 ++++ datatypes/es/question.json | 54 ++++++++++ datatypes/es/user2.json | 68 +++++++++++++ datatypes/mysql/EventStore | 129 ++++++++++++++++++++++++ 8 files changed, 433 insertions(+) create mode 100644 datatypes/es/client.json create mode 100644 datatypes/es/non-choice-questions.json create mode 100644 datatypes/es/question-subscription.json create mode 100644 datatypes/es/question-tags.json create mode 100644 datatypes/es/question-topics.json create mode 100644 datatypes/es/question.json create mode 100644 datatypes/es/user2.json create mode 100644 datatypes/mysql/EventStore diff --git a/datatypes/es/client.json b/datatypes/es/client.json new file mode 100644 index 0000000..8e0366a --- /dev/null +++ b/datatypes/es/client.json @@ -0,0 +1,26 @@ +{ + "settings": { + "number_of_shards": 3, + "number_of_replicas": 1, + "analysis": { + "normalizer": { + "lowercase": { + "type": "custom", + "filter": [ + "lowercase" + ] + } + } + } + }, + "mappings": { + "properties": { + "clientId": { + "type": "text" + }, + "name": { + "type": "text" + } + } + } +} \ No newline at end of file diff --git a/datatypes/es/non-choice-questions.json b/datatypes/es/non-choice-questions.json new file mode 100644 index 0000000..ece69c4 --- /dev/null +++ b/datatypes/es/non-choice-questions.json @@ -0,0 +1,38 @@ +{ + "settings": { + "index": { + "number_of_shards": 3, + "number_of_replicas": 1, + "sort.field": "sequenceNumber", + "sort.order": "asc" + } + }, + "mappings": { + "properties": { + "questionId": { + "type": "text" + }, + "sequenceNumber": { + "type": "long" + }, + "name": { + "type": "text" + }, + "tags": { + "type": "keyword" + }, + "clients": { + "type": "keyword" + }, + "topic": { + "type": "keyword" + }, + "difficulty": { + "type": "keyword" + }, + "frequency": { + "type": "keyword" + } + } + } +} \ No newline at end of file diff --git a/datatypes/es/question-subscription.json b/datatypes/es/question-subscription.json new file mode 100644 index 0000000..d06dc8c --- /dev/null +++ b/datatypes/es/question-subscription.json @@ -0,0 +1,83 @@ +{ + "settings": { + "number_of_shards": 3, + "number_of_replicas": 1, + "analysis": { + "normalizer": { + "lowercase": { + "type": "custom", + "filter": [ + "lowercase" + ] + } + } + } + }, + "mappings": { + "properties": { + "subscriptionId": { + "type": "keyword" + }, + "userId": { + "type": "keyword" + }, + "userFirstName": { + "type": "keyword" + }, + "userLastName": { + "type": "keyword" + }, + "userPreferredName": { + "type": "keyword" + }, + "userFullName": { + "type": "keyword", + "normalizer": "lowercase" + }, + "userEmail": { + "type": "keyword", + "normalizer": "lowercase" + }, + "userAvatar": { + "type": "keyword" + }, + "clientIds": { + "type": "keyword" + }, + "createDate": { + "type": "date", + "format": "uuuu-MM-dd'T'HH:mm:ss.SSS'Z['z']'" + }, + "totalLengthInDays": { + "type": "integer" + }, + "startDate": { + "type": "date", + "format": "uuuu-MM-dd'T'HH:mm:ss.SSS'Z['z']'" + }, + "endDate": { + "type": "date", + "format": "uuuu-MM-dd'T'HH:mm:ss.SSS'Z['z']'" + }, + "lastModifyDate": { + "type": "date", + "format": "uuuu-MM-dd'T'HH:mm:ss.SSS'Z['z']'" + }, + "batchCategoryName": { + "type": "keyword" + }, + "batchName": { + "type": "keyword" + }, + "subscribeAllClients": { + "type": "boolean" + }, + "confirmationNumber": { + "type": "keyword" + }, + "creatorFullName": { + "type": "keyword" + } + } + } +} \ No newline at end of file diff --git a/datatypes/es/question-tags.json b/datatypes/es/question-tags.json new file mode 100644 index 0000000..58db75e --- /dev/null +++ b/datatypes/es/question-tags.json @@ -0,0 +1,18 @@ +{ + "settings": { + "index": { + "number_of_shards": 3, + "number_of_replicas": 1 + } + }, + "mappings": { + "properties": { + "tag": { + "type": "text" + }, + "count": { + "type": "integer" + } + } + } +} \ No newline at end of file diff --git a/datatypes/es/question-topics.json b/datatypes/es/question-topics.json new file mode 100644 index 0000000..ae78173 --- /dev/null +++ b/datatypes/es/question-topics.json @@ -0,0 +1,17 @@ +{ + "settings": { + "index": { + "number_of_shards": 3, + "number_of_replicas": 1, + "sort.field": "topic", + "sort.order": "asc" + } + }, + "mappings": { + "properties": { + "topic": { + "type": "keyword" + } + } + } +} \ No newline at end of file diff --git a/datatypes/es/question.json b/datatypes/es/question.json new file mode 100644 index 0000000..c42e5f2 --- /dev/null +++ b/datatypes/es/question.json @@ -0,0 +1,54 @@ +{ + "settings": { + "number_of_shards": 3, + "number_of_replicas": 1, + "analysis": { + "normalizer": { + "lowercase": { + "type": "custom", + "filter": [ + "lowercase" + ] + } + } + } + }, + "mappings": { + "properties": { + "active": { + "type": "boolean" + }, + "answer": { + "type": "text" + }, + "codeBlock": { + "type": "text" + }, + "createdAt": { + "type": "date", + "format": "yyyy-MM-dd'T'HH:mm:ss" + }, + "description": { + "type": "text" + }, + "isActive": { + "type": "boolean" + }, + "name": { + "type": "text" + }, + "questionId": { + "type": "text" + }, + "tags": { + "type": "keyword" + }, + "topic": { + "type": "keyword" + }, + "weight": { + "type": "float" + } + } + } +} \ No newline at end of file diff --git a/datatypes/es/user2.json b/datatypes/es/user2.json new file mode 100644 index 0000000..e656ab3 --- /dev/null +++ b/datatypes/es/user2.json @@ -0,0 +1,68 @@ +{ + "settings": { + "number_of_shards": 3, + "number_of_replicas": 2 + }, + "mappings": { + "properties": { + "accountIds": { + "type": "keyword" + }, + "batchAddedDate": { + "type": "date", + "format": "uuuu-MM-dd'T'HH:mm:ss" + }, + "clients": { + "type": "keyword" + }, + "company": { + "type": "keyword" + }, + "companyId": { + "type": "keyword" + }, + "createdDate": { + "type": "date", + "format": "uuuu-MM-dd'T'HH:mm:ss" + }, + "email": { + "type": "keyword" + }, + "firstName": { + "type": "keyword" + }, + "fullName": { + "type": "text" + }, + "isActive": { + "type": "boolean" + }, + "lastName": { + "type": "keyword" + }, + "middleName": { + "type": "keyword" + }, + "preferredName": { + "type": "keyword" + }, + "status": { + "type": "keyword" + }, + "tags": { + "type": "nested", + "properties": { + "name": { + "type": "keyword" + }, + "value": { + "type": "keyword" + } + } + }, + "userId": { + "type": "text" + } + } + } +} \ No newline at end of file diff --git a/datatypes/mysql/EventStore b/datatypes/mysql/EventStore new file mode 100644 index 0000000..c322bb9 --- /dev/null +++ b/datatypes/mysql/EventStore @@ -0,0 +1,129 @@ +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; \ No newline at end of file