Merge branch 'master' of https://github.com/wso2/product-iot-server into entgra-master

# Conflicts:
#	pom.xml
357-notification-for-kiosk-mode
charitha 6 years ago
commit 2bf8e0db79

@ -140,7 +140,6 @@
<exclude>**/cdm-datasources.xml</exclude>
<exclude>**/tomcat/carbon/WEB-INF/web.xml</exclude>
<exclude>**/synapse.properties</exclude>
<exclude>**/etc/device-analytics-config.xml</exclude>
<exclude>**/synapse-handlers.xml</exclude>
<exclude>**/tomcat/context.xml</exclude>
<exclude>**/security/Owasp.CsrfGuard.Carbon.properties</exclude>
@ -691,6 +690,12 @@
<outputDirectory>${project.artifactId}-${pom.version}/wso2/tools/identity-anonymization-tool/conf/sql/apim</outputDirectory>
</fileSet>
<fileSet>
<directory>../migration</directory>
<outputDirectory>${project.artifactId}-${pom.version}/dbscripts</outputDirectory>
</fileSet>
<!-- ********************************* End of IoT Core Profile ********************************* -->
<!-- ********************************* Start of Analytics Profile ********************************* -->
@ -1244,20 +1249,6 @@
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>src/core/conf/etc/device-analytics-config.xml</source>
<outputDirectory>${pom.artifactId}-${pom.version}/conf/etc</outputDirectory>
<destName>device-analytics-config.xml</destName>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>src/core/conf/etc/device-analytics-config.xml</source>
<outputDirectory>${pom.artifactId}-${pom.version}/wso2/analytics/conf/etc</outputDirectory>
<destName>device-analytics-config.xml</destName>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<!-- Copying synapse-handlers.xml file -->
<file>
<source>src/core/conf/synapse-handlers.xml</source>
@ -1734,14 +1725,6 @@
${pom.artifactId}-${pom.version}/repository/resources/lifecycles
</outputDirectory>
</file>
<!-- Adding Geo Dashboard CApp -->
<file>
<source>
../p2-profile/iot-core-profile/target/wso2carbon-core-${carbon.kernel.version}/wso2/deployment/server/carbonapps/org_wso2_carbon_iot_geo_dashboard-1.0.0.car
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/resources/devicetypes/analytics/</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<source>src/core/samples/connectedcup-samples-deployer.xml</source>
<outputDirectory>${pom.artifactId}-${pom.version}/samples/</outputDirectory>

@ -167,7 +167,7 @@ set CARBON_CLASSPATH=.\lib;%CARBON_CLASSPATH%
set JAVA_ENDORSED=".\wso2\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"
set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dlogger.server.name="IoT-Core" -Dcatalina.base="%CARBON_HOME%\wso2\lib\tomcat" -Djava.util.logging.config.file="%CARBON_HOME%\conf\etc\logging-bridge.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcomponents.repo="%CARBON_HOME%\wso2\components\plugins" -Dcarbon.config.dir.path="%CARBON_HOME%\conf" -Dcarbon.components.dir.path="%CARBON_HOME%\wso2\components" -Dcarbon.extensions.dir.path="%CARBON_HOME%\extensions" -Dcarbon.dropins.dir.path="%CARBON_HOME%\dropins" -Dcarbon.external.lib.dir.path="%CARBON_HOME%\lib" -Dcarbon.patches.dir.path="%CARBON_HOME%\patches" -Dcarbon.servicepacks.dir.path="%CARBON_HOME%\servicepacks" -Dcarbon.internal.lib.dir.path="%CARBON_HOME%\wso2\lib" -Dconf.location="%CARBON_HOME%\conf" -Dcom.atomikos.icatch.file="%CARBON_HOME%\wso2\lib\transactions.properties" -Dcom.atomikos.icatch.hide_init_file_path=true -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dcom.sun.jndi.ldap.connect.pool.authentication=simple -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 -Dorg.terracotta.quartz.skipUpdateCheck=true -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dcom.ibm.cacheLocalHost=true -DworkerNode=false -Dorg.wso2.ignoreHostnameVerification=true -Dorg.opensaml.httpclient.https.disableHostnameVerification=true -Diot.analytics.host="localhost" -Diot.analytics.https.port="9445" -Diot.manager.host="localhost" -Diot.manager.https.port="9443" -Dmqtt.broker.host="localhost" -Dmqtt.broker.port="1886" -Diot.core.host="localhost" -Diot.core.https.port="9443" -Diot.keymanager.host="localhost" -Diot.keymanager.https.port="9443" -Diot.gateway.host="localhost" -Diot.gateway.https.port="8243" -Diot.gateway.http.port="8280" -Diot.gateway.carbon.https.port="9443" -Diot.gateway.carbon.http.port="9763" -Diot.apimpublisher.host="localhost" -Diot.apimpublisher.https.port="9443" -Diot.apimstore.host="localhost" -Diot.apimstore.https.port="9443"
set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dlogger.server.name="IoT-Core" -Dcatalina.base="%CARBON_HOME%\wso2\lib\tomcat" -Djava.util.logging.config.file="%CARBON_HOME%\conf\etc\logging-bridge.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcomponents.repo="%CARBON_HOME%\wso2\components\plugins" -Dcarbon.config.dir.path="%CARBON_HOME%\conf" -Dcarbon.components.dir.path="%CARBON_HOME%\wso2\components" -Dcarbon.extensions.dir.path="%CARBON_HOME%\extensions" -Dcarbon.dropins.dir.path="%CARBON_HOME%\dropins" -Dcarbon.external.lib.dir.path="%CARBON_HOME%\lib" -Dcarbon.patches.dir.path="%CARBON_HOME%\patches" -Dcarbon.servicepacks.dir.path="%CARBON_HOME%\servicepacks" -Dcarbon.internal.lib.dir.path="%CARBON_HOME%\wso2\lib" -Dconf.location="%CARBON_HOME%\conf" -Dcom.atomikos.icatch.file="%CARBON_HOME%\wso2\lib\transactions.properties" -Dcom.atomikos.icatch.hide_init_file_path=true -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dcom.sun.jndi.ldap.connect.pool.authentication=simple -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 -Dorg.terracotta.quartz.skipUpdateCheck=true -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dcom.ibm.cacheLocalHost=true -DworkerNode=false -Dorg.wso2.ignoreHostnameVerification=true -Dorg.opensaml.httpclient.https.disableHostnameVerification=true -Diot.analytics.host="localhost" -Diot.analytics.http.port="9765" -Diot.analytics.https.port="9445" -Diot.analytics.thrift.port="7613" -Diot.manager.host="localhost" -Diot.manager.https.port="9443" -Dmqtt.broker.host="localhost" -Dmqtt.broker.port="1886" -Diot.core.host="localhost" -Diot.core.https.port="9443" -Diot.keymanager.host="localhost" -Diot.keymanager.https.port="9443" -Diot.gateway.host="localhost" -Diot.gateway.https.port="8243" -Diot.gateway.http.port="8280" -Diot.gateway.carbon.https.port="9443" -Diot.gateway.carbon.http.port="9763" -Diot.apimpublisher.host="localhost" -Diot.apimpublisher.https.port="9443" -Diot.apimstore.host="localhost" -Diot.apimstore.https.port="9443"
:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%
echo CARBON_HOME environment variable is set to %CARBON_HOME%

@ -314,7 +314,9 @@ do
-Dorg.wso2.ignoreHostnameVerification=true \
-Dorg.opensaml.httpclient.https.disableHostnameVerification=true \
-Diot.analytics.host="localhost" \
-Diot.analytics.http.port="9765" \
-Diot.analytics.https.port="9445" \
-Diot.analytics.thrift.port="7613" \
-Diot.manager.host="localhost" \
-Diot.manager.https.port="9443" \
-Dmqtt.broker.host="localhost" \

@ -86,8 +86,8 @@
<Environment type="hybrid" api-console="true">
<Name>Production and Sandbox</Name>
<Description>This is a hybrid gateway that handles both production and sandbox token traffic.</Description>
<!-- Server URL of the API gateway -->
<ServerURL>https://${iot.gateway.host}:${iot.gateway.carbon.https.port}${carbon.context}services/</ServerURL>
<!-- Server URL of the API gateway manager/IoT Manager which has admin services hosted -->
<ServerURL>https://${iot.manager.host}:${iot.manager.https.port}${carbon.context}services/</ServerURL>
<!-- Admin username for the API gateway. -->
<Username>${admin.username}</Username>
<!-- Admin password for the API gateway.-->

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ you may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<AnalyticsConfiguration>
<!--
Server URL of the remote DAS/BAM/CEP server used to collect statistics. Must
be specified in protocol://hostname:port/ format.
An event can also be published to multiple Receiver Groups each having 1 or more receivers. Receiver
Groups are delimited by curly braces whereas receivers are delimited by commas.
Ex - Multiple Receivers within a single group
tcp://localhost:7612/,tcp://localhost:7613/,tcp://localhost:7614/
Ex - Multiple Receiver Groups with two receivers each
{tcp://localhost:7612/,tcp://localhost:7613},{tcp://localhost:7712/,tcp://localhost:7713/}
-->
<Enabled>true</Enabled>
<ReceiverServerUrl>tcp://localhost:7613</ReceiverServerUrl>
<AdminUsername>admin</AdminUsername>
<AdminPassword>admin</AdminPassword>
</AnalyticsConfiguration>

@ -89,7 +89,7 @@ public class DeviceTypeManagementJMeterTestCase extends TestBase {
// Allow some time for message delivery
Thread.sleep(10000);
ArrayList<MqttMessage> mqttMessages = mqttDeviceSubscriberClient.getMqttMessages();
Assert.assertEquals("listener did not recieve mqtt messages ", 1, mqttMessages.size());
Assert.assertEquals("listener did not recieve mqtt messages ", 0, mqttMessages.size());
String topicPub = automationContext.getContextTenant().getDomain() + "/"+deviceType+"/"+deviceId+"/events";
int qos = 2;

@ -0,0 +1,7 @@
ALTER TABLE AD_DEVICE
CHANGE COLUMN GCM_TOKEN FCM_TOKEN VARCHAR(1000) NULL DEFAULT NULL;
-- Run the following only if the both EMM 2.1.0 and IoT 3.3.1 has to run simultaneously.
ALTER TABLE AD_DEVICE
ADD COLUMN GCM_TOKEN VARCHAR(1000) NULL AFTER OS_BUILD_DATE;

@ -0,0 +1,248 @@
-- Before running this script, please make sure that DM_OPERATION does have the INITIATED_BY column. Some customers
-- may have it because of a patch. But Some customers may not have it, therefore depending on the situation, please
-- comment or uncomment one of first two ALTER TABLE DM_OPERATION SQL commands.
-- ALTER TABLE DM_OPERATION
-- ADD COLUMN INITIATED_BY VARCHAR(100) NULL DEFAULT NULL AFTER OPERATION_CODE;
ALTER TABLE DM_OPERATION
CHANGE COLUMN INITIATED_BY INITIATED_BY VARCHAR(100) NULL DEFAULT NULL;
ALTER TABLE DM_PROFILE
DROP FOREIGN KEY DM_PROFILE_DEVICE_TYPE;
ALTER TABLE DM_DEVICE_TYPE_POLICY
DROP FOREIGN KEY FK_DEVICE_TYPE_POLICY_DEVICE_TYPE;
ALTER TABLE DM_DEVICE_TYPE
ADD COLUMN DEVICE_TYPE_META VARCHAR(20000) NULL AFTER NAME,
ADD COLUMN LAST_UPDATED_TIMESTAMP TIMESTAMP NULL AFTER DEVICE_TYPE_META;
CREATE INDEX IDX_DEVICE_TYPE_PROVIDER ON DM_DEVICE_TYPE (NAME, PROVIDER_TENANT_ID);
CREATE INDEX IDX_DEVICE_TYPE_DEVICE_NAME ON DM_DEVICE_TYPE(ID, NAME);
CREATE TABLE IF NOT EXISTS DM_GROUP (
ID INTEGER AUTO_INCREMENT NOT NULL,
GROUP_NAME VARCHAR(100) DEFAULT NULL,
DESCRIPTION TEXT DEFAULT NULL,
OWNER VARCHAR(45) DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID)
)
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS DM_ROLE_GROUP_MAP (
ID INTEGER AUTO_INCREMENT NOT NULL,
GROUP_ID INTEGER DEFAULT NULL,
ROLE VARCHAR(45) DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID),
CONSTRAINT DM_ROLE_GROUP_MAP_DM_GROUP2 FOREIGN KEY (GROUP_ID)
REFERENCES DM_GROUP (ID)
ON DELETE CASCADE
ON UPDATE CASCADE
)
ENGINE = InnoDB;
CREATE INDEX IDX_DM_DEVICE_TYPE_ID_DEVICE_IDENTIFICATION ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID,DEVICE_IDENTIFICATION);
CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
DEVICE_TYPE_NAME VARCHAR(300) NOT NULL,
DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL,
PROPERTY_NAME VARCHAR(100) DEFAULT 0,
PROPERTY_VALUE VARCHAR(100) DEFAULT NULL,
TENANT_ID VARCHAR(100),
PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID)
)ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER DEFAULT NULL,
GROUP_ID INTEGER DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID),
CONSTRAINT fk_DM_DEVICE_GROUP_MAP_DM_DEVICE2 FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID)
ON DELETE CASCADE
ON UPDATE CASCADE ,
CONSTRAINT fk_DM_DEVICE_GROUP_MAP_DM_GROUP2 FOREIGN KEY (GROUP_ID)
REFERENCES DM_GROUP (ID)
ON DELETE CASCADE
ON UPDATE CASCADE
)
ENGINE = InnoDB;
CREATE INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID_STATUS ON DM_ENROLMENT(DEVICE_ID, TENANT_ID, STATUS);
ALTER TABLE DM_ENROLMENT_OP_MAPPING
ADD COLUMN PUSH_NOTIFICATION_STATUS VARCHAR(50) NULL AFTER STATUS;
CREATE INDEX IDX_EN_OP_MAPPING_EN_ID_STATUS ON DM_ENROLMENT_OP_MAPPING(ENROLMENT_ID, STATUS);
ALTER TABLE DM_DEVICE_APPLICATION_MAPPING
ADD COLUMN ENROLMENT_ID INT(11) NULL AFTER DEVICE_ID,
ADD COLUMN APP_PROPERTIES BLOB NULL AFTER TENANT_ID,
ADD COLUMN MEMORY_USAGE INT(11) NULL AFTER APP_PROPERTIES,
ADD COLUMN IS_ACTIVE TINYINT NULL AFTER MEMORY_USAGE;
SET SQL_SAFE_UPDATES = 0;
UPDATE DM_DEVICE_APPLICATION_MAPPING dam,
DM_ENROLMENT de,
DM_APPLICATION da
SET
dam.ENROLMENT_ID = de.ID,
dam.MEMORY_USAGE = da.MEMORY_USAGE,
dam.APP_PROPERTIES = da.APP_PROPERTIES,
dam.IS_ACTIVE = da.IS_ACTIVE
WHERE
dam.APPLICATION_ID = da.ID
AND dam.DEVICE_ID = de.DEVICE_ID
AND de.STATUS = 'ACTIVE';
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE DM_DEVICE_APPLICATION_MAPPING
CHANGE COLUMN IS_ACTIVE IS_ACTIVE TINYINT(4) NOT NULL ,
ADD INDEX FK_DM_APP_MAP_DM_ENROL_idx (ENROLMENT_ID ASC);
ALTER TABLE DM_DEVICE_APPLICATION_MAPPING
ADD CONSTRAINT FK_DM_APP_MAP_DM_ENROL
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
ALTER TABLE DM_DEVICE_GROUP_POLICY
DROP FOREIGN KEY FK_DM_DEVICE_GROUP_DM_POLICY,
DROP FOREIGN KEY FK_DM_DEVICE_GROUP_POLICY;
ALTER TABLE DM_DEVICE_GROUP_POLICY
ADD CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY
FOREIGN KEY (POLICY_ID)
REFERENCES DM_POLICY (ID)
ON DELETE CASCADE
ON UPDATE CASCADE,
ADD CONSTRAINT FK_DM_DEVICE_GROUP_POLICY
FOREIGN KEY (DEVICE_GROUP_ID)
REFERENCES DM_GROUP (ID)
ON DELETE CASCADE
ON UPDATE CASCADE;
ALTER TABLE DM_NOTIFICATION
DROP FOREIGN KEY fk_dm_operation_notification;
ALTER TABLE DM_NOTIFICATION
CHANGE COLUMN OPERATION_ID OPERATION_ID INT(11) NULL ,
ADD COLUMN LAST_UPDATED_TIMESTAMP TIMESTAMP NULL AFTER DESCRIPTION;
ALTER TABLE DM_NOTIFICATION
CHANGE COLUMN LAST_UPDATED_TIMESTAMP LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL ;
ALTER TABLE DM_DEVICE_INFO
ADD COLUMN ENROLMENT_ID INT(11) NULL AFTER DEVICE_ID;
SET SQL_SAFE_UPDATES = 0;
UPDATE DM_DEVICE_INFO di,
DM_ENROLMENT de
SET
di.ENROLMENT_ID = de.ID
WHERE
di.DEVICE_ID = de.DEVICE_ID
AND de.STATUS = 'ACTIVE';
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE DM_DEVICE_INFO
CHANGE COLUMN ENROLMENT_ID ENROLMENT_ID INT(11) NOT NULL,
ADD INDEX DM_DEVICE_LOCATION_DM_ENROLLMENT_idx (ENROLMENT_ID ASC);
ALTER TABLE DM_DEVICE_INFO
ADD CONSTRAINT DM_DEVICE_LOCATION_DM_ENROLLMENT
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
ALTER TABLE DM_DEVICE_LOCATION
CHANGE COLUMN STREET1 STREET1 VARCHAR(255) NULL DEFAULT NULL ,
CHANGE COLUMN STREET2 STREET2 VARCHAR(255) NULL DEFAULT NULL ,
ADD COLUMN ENROLMENT_ID INT(11) NULL AFTER DEVICE_ID,
ADD COLUMN GEO_HASH VARCHAR(45) NULL AFTER UPDATE_TIMESTAMP,
ADD INDEX DM_DEVICE_LOCATION_GEO_hashx (GEO_HASH ASC);
SET SQL_SAFE_UPDATES = 0;
UPDATE DM_DEVICE_LOCATION di,
DM_ENROLMENT de
SET
di.ENROLMENT_ID = de.ID
WHERE
di.DEVICE_ID = de.DEVICE_ID
AND de.STATUS = 'ACTIVE';
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE DM_DEVICE_LOCATION
CHANGE COLUMN ENROLMENT_ID ENROLMENT_ID INT(11) NOT NULL ,
ADD INDEX DM_DEVICE_LOCATION_DM_ENROLLMENT_idx (ENROLMENT_ID ASC);
ALTER TABLE DM_DEVICE_LOCATION
ADD CONSTRAINT FK_DM_DEVICE_LOCATION_DM_ENROLLMENT
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
ALTER TABLE DM_DEVICE_DETAIL
CHANGE COLUMN CONNECTION_TYPE CONNECTION_TYPE VARCHAR(50) NULL DEFAULT NULL ,
ADD COLUMN ENROLMENT_ID INT(11) NULL AFTER DEVICE_ID;
SET SQL_SAFE_UPDATES = 0;
UPDATE DM_DEVICE_DETAIL di,
DM_ENROLMENT de
SET
di.ENROLMENT_ID = de.ID
WHERE
di.DEVICE_ID = de.DEVICE_ID
AND de.STATUS = 'ACTIVE';
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE DM_DEVICE_DETAIL
CHANGE COLUMN ENROLMENT_ID ENROLMENT_ID INT(11) NOT NULL ,
ADD INDEX FK_DM_ENROLMENT_DEVICE_DETAILS_idx (ENROLMENT_ID ASC);
ALTER TABLE DM_DEVICE_DETAIL
ADD CONSTRAINT FK_DM_ENROLMENT_DEVICE_DETAILS
FOREIGN KEY (ENROLMENT_ID)
REFERENCES DM_ENROLMENT (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
-- TEMP TABLE REQUIRED FOR DATA ARCHIVAL JOB
CREATE TABLE IF NOT EXISTS DM_ARCHIVED_OPERATIONS (
ID INTEGER NOT NULL,
CREATED_TIMESTAMP TIMESTAMP NOT NULL,
PRIMARY KEY (ID)
)ENGINE = InnoDB;

@ -0,0 +1,75 @@
ALTER TABLE IOS_DEVICE
CHANGE COLUMN UNLOCK_TOKEN UNLOCK_TOKEN VARCHAR(5000) NULL DEFAULT NULL;
-- -----------------------------------------------------
-- Table IOS_DEVICE_PROFILE
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS IOS_DEVICE_PROFILE (
ID INT NOT NULL AUTO_INCREMENT,
OPERATION_ID VARCHAR(10) NOT NULL,
OPERATION_CODE VARCHAR(1000) NULL,
PROFILE_ID VARCHAR(1000) NULL,
DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL,
PROPERTIES TEXT DEFAULT NULL,
PRIMARY KEY (ID)
);
-- -----------------------------------------------------
-- Table IOS_ENROLLMENT_TOKEN
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS IOS_ENROLLMENT_TOKEN (
TENANT_DOMAIN VARCHAR(255) NOT NULL,
CHALLENGE_TOKEN VARCHAR(45) NOT NULL,
DEVICE_ID VARCHAR(45) DEFAULT NULL,
ACCESS_TOKEN VARCHAR(100) NOT NULL,
REFRESH_TOKEN VARCHAR(100) NOT NULL,
USERNAME VARCHAR(255) NOT NULL,
CLIENT_CREDENTIALS VARCHAR(255) NOT NULL,
AGENT_AVAILABLE VARCHAR(10) NOT NULL,
UNIQUE (TENANT_DOMAIN, CHALLENGE_TOKEN),
PRIMARY KEY (CHALLENGE_TOKEN)
) ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table IOS_DEP_PROFILE
-- -----------------------------------------------------
CREATE TABLE IOS_DEP_PROFILE (
ID INT NOT NULL AUTO_INCREMENT,
UUID VARCHAR(100) DEFAULT NULL,
PROFILE_NAME VARCHAR(200) DEFAULT NULL,
TENANT_DOMAIN VARCHAR(255) NOT NULL,
PROFILE_CONTENT Text DEFAULT NULL,
UNIQUE (UUID),
PRIMARY KEY (ID)
);
-- -----------------------------------------------------
-- Table IOS_PRE_ENROLLED_DEVICE
-- -----------------------------------------------------
CREATE TABLE IOS_PRE_ENROLLED_DEVICE (
ID INT NOT NULL AUTO_INCREMENT,
SERIAL VARCHAR(45) DEFAULT NULL,
DEVICE_IDENTIFIER VARCHAR(45) DEFAULT NULL,
USERNAME VARCHAR(255),
TENANT_DOMAIN VARCHAR(255) NOT NULL,
STATUS VARCHAR(100) DEFAULT NULL,
DEP_PROFILE_ID INT DEFAULT NULL,
PROFILE_ASSIGN_TIME TIMESTAMP NULL,
PROFILE_PUSH_TIME TIMESTAMP NULL,
DEVICE_ASSIGNED_TIME TIMESTAMP NULL,
DEVICE_ASSIGNED_BY VARCHAR(100) DEFAULT NULL,
NEED_BASIC_AUTH INT DEFAULT 0,
IS_AGENT_REQUIRED INT DEFAULT 0,
OS VARCHAR(45) DEFAULT NULL,
DEVICE_FAMILY VARCHAR(45) DEFAULT NULL,
DEVICE_MODEL VARCHAR(45) DEFAULT NULL,
DESCRIPTION VARCHAR(200) DEFAULT NULL,
COLOR VARCHAR(200) DEFAULT NULL,
UNIQUE (SERIAL),
PRIMARY KEY (ID),
CONSTRAINT fk_IOS_PRE_ENROLLED_DEVICE_IOS_DEP_PROFILE
FOREIGN KEY (DEP_PROFILE_ID)
REFERENCES IOS_DEP_PROFILE (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);

@ -393,10 +393,6 @@
<featureArtifactDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.identity.jwt.client.extension.feature:${carbon.device.mgt.version}
</featureArtifactDef>
<!-- Geo Dashboard feature -->
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.iot.geo.dashboard.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics.shared:org.wso2.carbon.analytics.shared.spark.common.udf.feature:${analytics.shared.version}
</featureArtifactDef>
@ -410,9 +406,7 @@
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<!-- GPL Siddhi Extension Script for Geo Fencing -->
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.gpl.siddhi.extension.geo.script.feature:${carbon.device.mgt.plugin.version}
@ -863,16 +857,8 @@
<id>org.wso2.carbon.analytics.gadget.template.feature.group</id>
<version>${carbon.analytics.common.version}</version>
</feature>
<!-- End of IoT Analytics Features -->
<!-- Geo Dashboard Feature -->
<feature>
<id>org.wso2.carbon.iot.geo.dashboard.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- End of Geo Dashboard Feature -->
<!-- Siddhi extension Feature -->
<feature>
<id>org.wso2.extension.siddhi.execution.json.feature.group</id>
@ -882,16 +868,6 @@
<id>org.wso2.extension.siddhi.device.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.iot.analytics.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!--android sense analytics feature-->
<feature>
<id>org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- GPL Siddhi Extension Script for Geo Fencing -->
<feature>
<id>org.wso2.gpl.siddhi.extension.geo.script.feature.group</id>

@ -137,7 +137,7 @@
org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.webapp.publisher.feature:${carbon.device.mgt.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.analytics.data.publisher.feature:${carbon.device.mgt.version}
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.analytics.feature:${carbon.device.mgt.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.identity.jwt.client.extension.feature:${carbon.device.mgt.version}
@ -180,12 +180,6 @@
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.windows.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.ui.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.backend.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.notification.listener.feature:${carbon.device.mgt.plugin.version}
@ -777,7 +771,10 @@
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.iot.geo.dashboard.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<!-- End of Geo Dashboard feature -->
<!-- IoT Analytics feature -->
<featureArtifactDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
<!-- Realtime Operations Feature -->
<featureArtifactDef>
@ -1030,7 +1027,7 @@
<version>${carbon.device.mgt.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.analytics.data.publisher.feature.group</id>
<id>org.wso2.carbon.device.mgt.analytics.feature.group</id>
<version>${carbon.device.mgt.version}</version>
</feature>
<feature>
@ -1060,14 +1057,6 @@
<feature>
<id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.iot.androidsense.ui.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.notification.listener.feature.group</id>
@ -1721,7 +1710,11 @@
<id>org.wso2.carbon.iot.geo.dashboard.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- End of Geo Dashboard Feature -->
<!-- IoT Analytics Feature -->
<feature>
<id>org.wso2.carbon.device.mgt.iot.analytics.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- Realtime Operations Feature -->
<feature>
<id>org.wso2.carbon.device.mgt.remote.session.feature.group</id>
@ -2120,7 +2113,7 @@
<version>${carbon.consent.mgt.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.analytics.data.publisher.feature.group</id>
<id>org.wso2.carbon.device.mgt.analytics.feature.group</id>
<version>${carbon.device.mgt.version}</version>
</feature>
<feature>
@ -2147,10 +2140,6 @@
<id>org.wso2.carbon.device.mgt.mobile.android.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.iot.androidsense.ui.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
@ -2624,7 +2613,11 @@
<id>org.wso2.carbon.iot.geo.dashboard.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- End of Geo Dashboard Feature -->
<!-- IoT Analytics Feature -->
<feature>
<id>org.wso2.carbon.device.mgt.iot.analytics.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- Realtime Operations Feature -->
<feature>
<id>org.wso2.carbon.device.mgt.remote.session.feature.group</id>
@ -2632,11 +2625,11 @@
</feature>
<!-- End of Realtime Operations Feature -->
<!--MQTT Dashboard Feature-->
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.api.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!--MQTT Dashboard Feature-->
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.api.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
</features>
</configuration>
</execution>
@ -2765,7 +2758,7 @@
<version>${carbon.device.mgt.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.analytics.data.publisher.feature.group</id>
<id>org.wso2.carbon.device.mgt.analytics.feature.group</id>
<version>${carbon.device.mgt.version}</version>
</feature>
<feature>
@ -2792,10 +2785,6 @@
<id>org.wso2.carbon.device.mgt.mobile.android.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.device.mgt.mobile.windows.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
@ -3254,18 +3243,22 @@
<id>org.wso2.carbon.iot.geo.dashboard.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- End of Geo Dashboard Feature -->
<!-- IoT Analytics Feature -->
<feature>
<id>org.wso2.carbon.device.mgt.iot.analytics.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- Realtime Operations Feature -->
<feature>
<id>org.wso2.carbon.device.mgt.remote.session.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!-- End of Realtime Operations Feature -->
<!--MQTT Dashboard Feature-->
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.api.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
<!--MQTT Dashboard Feature-->
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.api.feature.group</id>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
</features>
</configuration>
</execution>

Loading…
Cancel
Save