README
======
For an introduction to Joget DX, please refer to https://community.joget.org

UPGRADING
=========
For details on upgrading from previous releases, please refer to https://www.joget.org/updates/upgrade

Prerequisites
-------------
- Linux (The current bundle is only packaged for Linux)
- Java 11 and above
- MySQL 5.6 and above



Documentation
------------------
- Please refer to the PDF in the /docs directory.
- Latest documentation is available at the Knowledge Base https://community.joget.org


Upgrading from v3.0 to v3.1
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; ALTER TABLE dir_user ADD locale VARCHAR(255);  "}' | mysql -uroot -f

Upgrading from v3.1 to v4.0
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; CREATE TABLE `dir_user_extra` ( `username` varchar(255) NOT NULL, `algorithm` varchar(255) DEFAULT NULL, `loginAttempt` int(11) DEFAULT NULL, `failedloginAttempt` int(11) DEFAULT NULL, `lastLogedInDate` datetime DEFAULT NULL, `lockOutDate` datetime DEFAULT NULL, `lastPasswordChangeDate` datetime DEFAULT NULL, `requiredPasswordChange` bit(1) DEFAULT NULL, `noPasswordExpiration` bit(1) DEFAULT NULL, PRIMARY KEY (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `dir_user_password_history` (`id` varchar(255) NOT NULL, `username` varchar(255) DEFAULT NULL, `salt` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `updatedDate` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; "}' | mysql -uroot -f

Upgrading from v4.0 to v4.0.6
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; ALTER TABLE app_package_activity_form ADD disableSaveAsDraft BIT(1); "}' | mysql -uroot -f

Upgrading from v4.0.6 to v5.0
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; ALTER TABLE app_app ADD description TEXT; ALTER TABLE app_app ADD meta TEXT; ALTER TABLE app_form ADD description TEXT; CREATE TABLE `app_form_data_audit_trail` ( `id` varchar(255) NOT NULL, `appId` varchar(255), `appVersion` varchar(255), `formId` varchar(255), `tableName` varchar(255), `username` varchar(255), `action` varchar(255), `data` text, `datetime` datetime, PRIMARY KEY (`id`)); "}' | mysql -uroot -f

Upgrading from v5.0 to v6.0
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; CREATE TABLE `dir_user_replacement` ( `id` varchar(255) NOT NULL, `username` varchar(255) DEFAULT NULL, `replacementUser` varchar(255) DEFAULT NULL, `appId` varchar(255) DEFAULT NULL, `processIds` varchar(255) DEFAULT NULL, `startDate` datetime DEFAULT NULL, `endDate` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `dir_user_meta` ( `username` varchar(255) NOT NULL, `meta_key` varchar(255) NOT NULL, `meta_value` longtext, PRIMARY KEY (`username`,`meta_key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `app_resource` ( `appId` varchar(255) NOT NULL, `appVersion` bigint(20) NOT NULL, `id` varchar(255) NOT NULL, `filesize` bigint(20), `permissionClass` varchar(255), `permissionProperties` longtext, PRIMARY KEY (`appId`,`appVersion`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; "}' | mysql -uroot -f

Upgrading from v6.0 to DX 7
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; CREATE TABLE `app_builder` ( `appId` varchar(255) NOT NULL, `appVersion` bigint(20) NOT NULL, `id` varchar(255) NOT NULL, `name` varchar(255) DEFAULT NULL, `type` varchar(255) DEFAULT NULL, `dateCreated` datetime DEFAULT NULL, `dateModified` datetime DEFAULT NULL, `json` longtext, `description` longtext, PRIMARY KEY (`appId`,`appVersion`,`id`), KEY `idx_name` (`name`), KEY `idx_type` (`type`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"}' | mysql -uroot -f

Upgrading from DX 7 to DX 8
---------------------------
- Database schema change required for all databases, execute the following script once to perform the update:
  mysql -uroot -e "SHOW DATABASES" | awk '/^jwc_/ {print "USE ", $1, "; CREATE TABLE `wf_process_link_history` (`processId` varchar(255) NOT NULL, `parentProcessId` varchar(255) DEFAULT NULL, `originProcessId` varchar(255) DEFAULT NULL, PRIMARY KEY (`processId`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `wf_history_process` ( `processId` varchar(255) NOT NULL, `processName` varchar(255) DEFAULT NULL, `processRequesterId` varchar(255) DEFAULT NULL, `resourceRequesterId` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, `processDefId` varchar(255) DEFAULT NULL, `started` bigint(20) DEFAULT NULL, `created` bigint(20) DEFAULT NULL, `lastStateTime` bigint(20) DEFAULT NULL, `limitDuration` varchar(255) DEFAULT NULL, `due` datetime DEFAULT NULL, `state` varchar(255) DEFAULT NULL, `variables` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`processId`), CONSTRAINT `FK_prxyxtqy6byfrq3l5qght53l6` FOREIGN KEY (`processId`) REFERENCES `wf_process_link_history` (`processId`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `wf_history_activity` (`activityId` varchar(255) NOT NULL, `activityName` varchar(255) DEFAULT NULL, `activityDefId` varchar(255) DEFAULT NULL, `activated` bigint(20) DEFAULT NULL, `accepted` bigint(20) DEFAULT NULL, `lastStateTime` bigint(20) DEFAULT NULL, `limitDuration` varchar(255) DEFAULT NULL, `participantId` varchar(255) DEFAULT NULL, `assignmentUsers` varchar(255) DEFAULT NULL, `performer` varchar(255) DEFAULT NULL, `state` varchar(255) DEFAULT NULL, `type` varchar(255) DEFAULT NULL, `due` datetime DEFAULT NULL, `variables` text COLLATE utf8_unicode_ci DEFAULT NULL, `processId` varchar(255) DEFAULT NULL, PRIMARY KEY (`activityId`), KEY `FK_7mmrnb28ugrdxpf0dpw35y73u` (`processId`), CONSTRAINT `FK_7mmrnb28ugrdxpf0dpw35y73u` FOREIGN KEY (`processId`) REFERENCES `wf_history_process` (`processId`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"}' | mysql -uroot -f