diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/sql/h2.sql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/sql/h2.sql index cc69537e903..2c846cb1af6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/sql/h2.sql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/sql/h2.sql @@ -75,8 +75,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP ( CREATE TABLE IF NOT EXISTS DM_OPERATION ( ID INTEGER AUTO_INCREMENT NOT NULL, TYPE VARCHAR(50) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + RECEIVED_TIMESTAMP TIMESTAMP NULL, OPERATION_CODE VARCHAR(1000) NOT NULL, INITIATED_BY VARCHAR(100) NULL, OPERATION_DETAILS BLOB DEFAULT NULL, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/test/resources/sql-files/h2.sql b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/test/resources/sql-files/h2.sql index ef684a66851..7d7c1ece9cf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/test/resources/sql-files/h2.sql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/test/resources/sql-files/h2.sql @@ -65,8 +65,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP ( CREATE TABLE IF NOT EXISTS DM_OPERATION ( ID INTEGER AUTO_INCREMENT NOT NULL, TYPE VARCHAR(50) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + RECEIVED_TIMESTAMP TIMESTAMP NULL, OPERATION_CODE VARCHAR(1000) NOT NULL, PRIMARY KEY (ID) ); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql index 4c59adb953d..7238d37790e 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/sql/CreateH2TestDB.sql @@ -83,8 +83,8 @@ DROP TABLE IF EXISTS DM_OPERATION; CREATE TABLE IF NOT EXISTS DM_OPERATION ( ID INTEGER AUTO_INCREMENT NOT NULL, TYPE VARCHAR(50) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + RECEIVED_TIMESTAMP TIMESTAMP NULL, OPERATION_CODE VARCHAR(1000) NOT NULL, INITIATED_BY VARCHAR(100) NULL, OPERATION_DETAILS BLOB DEFAULT NULL, diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql index 150480f68df..dcbebd74b45 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql @@ -79,7 +79,7 @@ CREATE TABLE IF NOT EXISTS AP_APP_LIFECYCLE_STATE( PREVIOUS_STATE VARCHAR(45) NOT NULL, TENANT_ID INTEGER NOT NULL, UPDATED_BY VARCHAR(100) NOT NULL, - UPDATED_AT BIGINT NOT NULL, + UPDATED_AT TIMESTAMP NOT NULL, AP_APP_RELEASE_ID INTEGER NOT NULL, REASON TEXT DEFAULT NULL, PRIMARY KEY (ID), diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql index 5d29525a8c5..25fc47e38e8 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql @@ -80,7 +80,7 @@ CREATE TABLE AP_APP_LIFECYCLE_STATE( PREVIOUS_STATE VARCHAR(45) NOT NULL, TENANT_ID INTEGER NOT NULL, UPDATED_BY VARCHAR(100) NOT NULL, - UPDATED_AT BIGINT NOT NULL, + UPDATED_AT DATETIME2(0) NOT NULL, AP_APP_RELEASE_ID INTEGER NOT NULL, REASON VARCHAR(max) DEFAULT NULL, PRIMARY KEY (ID), diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql index c799b032453..d871549d896 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql @@ -87,7 +87,7 @@ CREATE TABLE IF NOT EXISTS AP_APP_LIFECYCLE_STATE( PREVIOUS_STATE VARCHAR(45) NOT NULL, TENANT_ID INTEGER NOT NULL, UPDATED_BY VARCHAR(100) NOT NULL, - UPDATED_AT BIGINT NOT NULL, + UPDATED_AT TIMESTAMP(0) NOT NULL, AP_APP_RELEASE_ID INTEGER NOT NULL, REASON TEXT DEFAULT NULL, PRIMARY KEY (ID), diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/archival/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/archival/mysql.sql index 7854ee11815..659e22d110b 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/archival/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/archival/mysql.sql @@ -2,8 +2,8 @@ CREATE TABLE IF NOT EXISTS DM_OPERATION_ARCH ( ID INTEGER NOT NULL, TYPE VARCHAR(20) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + RECEIVED_TIMESTAMP TIMESTAMP NULL, OPERATION_CODE VARCHAR(50) NOT NULL, INITIATED_BY VARCHAR(100) NULL, OPERATION_DETAILS BLOB DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql index ed9ce41c7dc..f6894eb4ac1 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -84,8 +84,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_MAP ( CREATE TABLE IF NOT EXISTS DM_OPERATION ( ID INTEGER AUTO_INCREMENT NOT NULL, TYPE VARCHAR(50) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + RECEIVED_TIMESTAMP TIMESTAMP NULL, OPERATION_CODE VARCHAR(1000) NOT NULL, INITIATED_BY VARCHAR(100) NULL, OPERATION_DETAILS BLOB DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql index f0cbcf24583..c27f8914452 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -111,8 +111,8 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[D CREATE TABLE DM_OPERATION ( ID INTEGER IDENTITY(1,1) NOT NULL, TYPE VARCHAR(20) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP DATETIME2 NOT NULL, + RECEIVED_TIMESTAMP DATETIME2 NULL, OPERATION_CODE VARCHAR(50) NOT NULL, INITIATED_BY VARCHAR(100) NULL, OPERATION_DETAILS VARBINARY(MAX) DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql index 00adba35005..e2e4693bd23 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -173,8 +173,8 @@ WHEN (NEW.ID IS NULL) CREATE TABLE DM_OPERATION ( ID NUMBER(10) NOT NULL, TYPE VARCHAR2(50) NOT NULL, - CREATED_TIMESTAMP BIGINT NOT NULL, - RECEIVED_TIMESTAMP BIGINT NULL, + CREATED_TIMESTAMP TIMESTAMP(0) NOT NULL, + RECEIVED_TIMESTAMP TIMESTAMP(0) NULL, OPERATION_CODE VARCHAR2(1000) NOT NULL, INITIATED_BY VARCHAR2(100) NULL, ENABLED NUMBER(10) DEFAULT 0 NOT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql index d2537af3a88..bd8eb8771ac 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -93,7 +93,7 @@ CREATE SEQUENCE DM_OPERATION_seq; CREATE TABLE IF NOT EXISTS DM_OPERATION ( ID INTEGER DEFAULT NEXTVAL ('DM_OPERATION_seq') NOT NULL, TYPE VARCHAR(20) NOT NULL, - CREATED_TIMESTAMP NOT NULL, + CREATED_TIMESTAMP TIMESTAMP(0) NOT NULL, RECEIVED_TIMESTAMP TIMESTAMP(0) NULL, OPERATION_CODE VARCHAR(50) NOT NULL, INITIATED_BY VARCHAR(100) NULL,