From a7fc442df8277f6cb990a5efc66a659333f4e6c3 Mon Sep 17 00:00:00 2001
From: "m.groppe" <m.groppe@adito.de>
Date: Mon, 12 Apr 2021 09:48:42 +0200
Subject: [PATCH] Indexe erstellt

---
 .../2021.0.3/Bulkmail/createLinkClicks.xml     |  3 +++
 .../basic/2021.0.3/Bulkmail/createMailLog.xml  |  9 +++++++--
 .../basic/2021.0.3/Bulkmail/createMailRun.xml  |  5 ++++-
 .../_____LANGUAGE_EXTRA.aod                    | 18 ++++++++++++++++++
 language/_____LANGUAGE_de/_____LANGUAGE_de.aod |  8 ++++++++
 language/_____LANGUAGE_en/_____LANGUAGE_en.aod | 18 ++++++++++++++++++
 process/redirect_rest/process.js               |  3 +--
 7 files changed, 59 insertions(+), 5 deletions(-)

diff --git a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml
index 0fefe44468..c2e7315e43 100644
--- a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml
+++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createLinkClicks.xml
@@ -13,5 +13,8 @@
             <column name="BROWSER" type="VARCHAR(255)"/>
             <column name="DATE_OPENED" type="datetime"/>
         </createTable>
+        <createIndex tableName="LINK_CLICK" indexName="IDX_LINK_CLICK_MAIL_LOG_ID">
+          <column name="MAIL_LOG_ID"/>
+        </createIndex>
     </changeSet>
 </databaseChangeLog>
\ No newline at end of file
diff --git a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml
index be2a3ac4d2..a1b61bd322 100644
--- a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml
+++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailLog.xml
@@ -1,7 +1,7 @@
 <?xml version="1.1" encoding="UTF-8" standalone="no"?>
 <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
     <changeSet author="m.groppe" id="9d8f3580-92c5-423e-b709-09383969ccf0">
-        <createTable tableName="mail_log">
+        <createTable tableName="MAIL_LOG">
             <column name="MAIL_LOGID" type="CHAR(36)">
                 <constraints nullable="false" primaryKey="true"/>
             </column>
@@ -14,8 +14,13 @@
             <column name="RECIPIENT_EMAIL" type="VARCHAR(255)"/>
             <column name="MAILING_SUBJECT" type="VARCHAR(100)"/>
             <column name="DATE_SEND" type ="DATETIME"/>
-            <column name="FILEPATH" type="VARCHAR(255)"/>
             <column name="OPENER_LINK_CLICK_ID" type="char(36)"/>
         </createTable>
+        <createIndex tableName="MAIL_LOG" indexName="IDX_MAIL_LOG_MAIL_RUN_ID">
+          <column name="MAIL_RUN_ID"/>
+        </createIndex>
+        <createIndex tableName="MAIL_LOG" indexName="IDX_MAIL_LOG_OPENER_LINK_CLICK_ID">
+          <column name="OPENER_LINK_CLICK_ID"/>
+        </createIndex>
     </changeSet>
 </databaseChangeLog>
\ No newline at end of file
diff --git a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml
index be6e99e582..d822f108f8 100644
--- a/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml
+++ b/.liquibase/Data_alias/basic/2021.0.3/Bulkmail/createMailRun.xml
@@ -1,7 +1,7 @@
 <?xml version="1.1" encoding="UTF-8" standalone="no"?>
 <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
     <changeSet author="m.groppe" id="6c910d60-43b1-400b-8e31-e3a1a93155e6">
-        <createTable tableName="mail_run">
+        <createTable tableName="MAIL_RUN">
             <column name="MAIL_RUNID" type="CHAR(36)">
                 <constraints nullable="false" primaryKey="true"/>
             </column>
@@ -13,5 +13,8 @@
             <column defaultValueComputed="NULL" name="DATE_RUN_START" type="datetime"/>
             <column defaultValueComputed="NULL" name="DATE_RUN_FINISHED" type="datetime"/>
         </createTable>
+        <createIndex tableName="LINK_CLICK" indexName="IDX_MAIL_RUN_INTEREST_ID">
+          <column name="INTEREST_ID"/>
+        </createIndex>
     </changeSet>
 </databaseChangeLog>
\ No newline at end of file
diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
index a8f3d64a26..e4c4fe0454 100644
--- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
+++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod
@@ -8199,6 +8199,24 @@
     <entry>
       <key>Link Type</key>
     </entry>
+    <entry>
+      <key>Clicks</key>
+    </entry>
+    <entry>
+      <key>Device Type</key>
+    </entry>
+    <entry>
+      <key>Mobile</key>
+    </entry>
+    <entry>
+      <key>Console</key>
+    </entry>
+    <entry>
+      <key>IP Address</key>
+    </entry>
+    <entry>
+      <key>Operating System</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
   <sqlModels>
diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
index b654041a3c..8aec588bf7 100644
--- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
+++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod
@@ -51,6 +51,10 @@
       <key>EML files can't be edited here. You can download, edit and reupload the template to change the content.</key>
       <value>Das Bearbeiten von EML-Dateien ist hier nicht möglich. Um den Inhalt zu ändern, können Sie die Vorlage herunterladen, bearbeiten und erneut hochladen.</value>
     </entry>
+    <entry>
+      <key>Date Clicked</key>
+      <value>Klickdatum</value>
+    </entry>
     <entry>
       <key>Checklist entries</key>
       <value>Checklisteneinträge</value>
@@ -63,6 +67,10 @@
       <key>Project team: \"Project manager\"</key>
       <value>Projektteam: \"Projektmanager\"</value>
     </entry>
+    <entry>
+      <key>Send Date</key>
+      <value>Versanddatum</value>
+    </entry>
     <entry>
       <key>Checklist entry</key>
       <value>Checklisteneintrag</value>
diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
index ca45a8c4b7..4c1e0ad81c 100644
--- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
+++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod
@@ -8280,6 +8280,24 @@
     <entry>
       <key>Link Type</key>
     </entry>
+    <entry>
+      <key>Clicks</key>
+    </entry>
+    <entry>
+      <key>Device Type</key>
+    </entry>
+    <entry>
+      <key>Mobile</key>
+    </entry>
+    <entry>
+      <key>Console</key>
+    </entry>
+    <entry>
+      <key>IP Address</key>
+    </entry>
+    <entry>
+      <key>Operating System</key>
+    </entry>
   </keyValueMap>
   <font name="Dialog" style="0" size="11" />
 </language>
diff --git a/process/redirect_rest/process.js b/process/redirect_rest/process.js
index c1e54b29b6..c567e0b992 100644
--- a/process/redirect_rest/process.js
+++ b/process/redirect_rest/process.js
@@ -13,10 +13,9 @@ function restget (pRequest)
     var mailLogId = request.query.log;
     var ipAddress = BulkMailUtils.getIpAddressFromHeader(request.header);
     var redirectLink = BulkMailUtils.getRedirectLink(linkId);
-
     var UserAgentObject = new UAParser(request.header["User-agent"]).getResult();
 
-    BulkMailUtils.insertClick(ipAddress,mailLogId,linkId,UserAgentObject.browser.name,UserAgentObject.os.name,UserAgentObject.device.type);
+    BulkMailUtils.insertClick(mailLogId,ipAddress,linkId,UserAgentObject.browser.name,UserAgentObject.os.name,UserAgentObject.device.type);
         
     BulkMailUtils.startBulkmailWorkFlow(mailLogId,linkId);
     
-- 
GitLab