<?php
/**
 * Created by PhpStorm.
 * User: crose
 * Date: 5/9/17
 * Time: 9:38 AM
 */

// Always put the latest updates to the end!!!
$UPDATE_ARRAY = array(

    '0.12.0' => [
        "ALTER TABLE  `FormElement` ADD `rowLabelInputNote` SET('row','label','/label','input','/input','note','/note','/row') NOT NULL DEFAULT 'row,label,/label,input,/input,note,/note,/row' AFTER  `bsNoteColumns` ",
        "ALTER TABLE  `FormElement` CHANGE  `type`  `type` ENUM(  'checkbox',  'date',  'datetime',  'dateJQW',  'datetimeJQW',  'extra', 'gridJQW',  'text',  'editor',  'time',  'note',  'password',  'radio',  'select',  'subrecord',  'upload',  'fieldset', 'pill',     'templateGroup',  'beforeLoad',  'beforeSave',  'beforeInsert',  'beforeUpdate',  'beforeDelete',  'afterLoad',  'afterSave', 'afterInsert',  'afterUpdate',  'afterDelete',  'sendMail' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'text' ",
    ],

    '0.13.0' => [
        "ALTER TABLE FormElement MODIFY COLUMN checkType ENUM('alnumx','digit','numerical','email','min|max','min|max date', 'pattern','allbut','all') NOT NULL DEFAULT 'alnumx' ",
    ],

    '0.14.0' => [
        "ALTER TABLE `FormElement` CHANGE `placeholder` `placeholder` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ",
    ],

    '0.15.0' => [
        "UPDATE `FormElement` SET `parameter` = REPLACE(parameter, 'typeAheadLdapKeyPrintf', 'typeAheadLdapIdPrintf')",
        "ALTER TABLE  `FormElement` CHANGE  `placeholder`  `placeholder` VARCHAR( 2048 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ",
    ],

    '0.16.0' => [
        "ALTER TABLE `FormElement` ADD INDEX `feIdContainer` (`feIdContainer`)",
        "ALTER TABLE `FormElement` ADD INDEX `ord` (`ord`)",
        "ALTER TABLE `FormElement` ADD `adminNote` TEXT NOT NULL AFTER `note`",
    ],

    '0.17.0' => [
        "ALTER TABLE  `FormElement` ADD  `encode` ENUM(  'none',  'specialchar' ) NOT NULL DEFAULT  'specialchar' AFTER  `subrecordOption`",
        "UPDATE `FormElement` SET encode='none' WHERE class='native' AND type='editor'",

        "ALTER TABLE  `Form` ADD  `escapeTypeDefault` VARCHAR(32) NOT NULL DEFAULT  'c' AFTER  `permitEdit`",
        "UPDATE `Form` SET `escapeTypeDefault`='-'",
    ],

    '0.18.0' => [
        "ALTER TABLE  `Form` CHANGE  `forwardMode`  `forwardMode` ENUM(  'client',  'no',  'page',  'url',  'url-skip-history' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'client'",
        "UPDATE `Form` SET `forwardMode`='url' WHERE `forwardMode`='page'",
        "ALTER TABLE  `Form` CHANGE  `forwardMode`  `forwardMode` ENUM(  'client',  'no',  'url',  'url-skip-history' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'client'",
    ],

    '0.18.3' => [
        "ALTER TABLE  `FormElement` CHANGE  `type`  `type` ENUM(  'checkbox',  'date',  'datetime',  'dateJQW',  'datetimeJQW',  'extra',  'gridJQW',  'text',  'editor',  'time', 'note',  'password',  'radio',  'select',  'subrecord',  'upload',  'fieldset',  'pill',  'templateGroup',  'beforeLoad',  'beforeSave',  'beforeInsert',  'beforeUpdate',  'beforeDelete', 'afterLoad',  'afterSave',  'afterInsert',  'afterUpdate',  'afterDelete',  'sendMail',  'paste' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'text';",
        "ALTER TABLE  `Form` CHANGE  `forwardMode`  `forwardMode` ENUM(  'client',  'no',  'url',  'url-skip-history',  'url-sip' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'client';",
    ],

    '0.19.0' => [
        "ALTER TABLE  `Form` ADD  `dirtyMode` ENUM( 'exclusive', 'advisory', 'none' ) NOT NULL DEFAULT  'exclusive' AFTER  `requiredParameter`",
        "ALTER TABLE  `Form` ADD  `recordLockTimeoutSeconds` INT NOT NULL DEFAULT  '900' AFTER  `parameter`",
        "CREATE TABLE IF NOT EXISTS `Period` (`id` INT(11) NOT NULL AUTO_INCREMENT, `start` DATETIME NOT NULL, `name` VARCHAR(255) NOT NULL, `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `start` (`start`)) ENGINE = InnoDB DEFAULT CHARSET = utf8 AUTO_INCREMENT = 0;",
        "INSERT INTO `Period` (`start`, `name`, `created`) VALUES (NOW(), 'dummy', NOW());"
    ],

    '0.19.5' => [
        "ALTER TABLE `Form` ADD `parameterLanguageA` TEXT NOT NULL AFTER `parameter`",
        "ALTER TABLE `Form` ADD `parameterLanguageB` TEXT NOT NULL AFTER `parameterLanguageA`",
        "ALTER TABLE `Form` ADD `parameterLanguageC` TEXT NOT NULL AFTER `parameterLanguageB`",
        "ALTER TABLE `Form` ADD `parameterLanguageD` TEXT NOT NULL AFTER `parameterLanguageC`",

        "ALTER TABLE `FormElement` ADD `parameterLanguageA` TEXT NOT NULL AFTER `parameter`",
        "ALTER TABLE `FormElement` ADD `parameterLanguageB` TEXT NOT NULL AFTER `parameterLanguageA`",
        "ALTER TABLE `FormElement` ADD `parameterLanguageC` TEXT NOT NULL AFTER `parameterLanguageB`",
        "ALTER TABLE `FormElement` ADD `parameterLanguageD` TEXT NOT NULL AFTER `parameterLanguageC`",
    ],

    '0.21.0' => [
        "ALTER TABLE  `Form` CHANGE  `requiredParameter`  `requiredParameterNew` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  ''",
        "ALTER TABLE  `Form` ADD  `requiredParameterEdit` VARCHAR( 255 ) NOT NULL AFTER  `requiredParameterNew`",
        "UPDATE `Form` SET `requiredParameterEdit`=requiredParameterNew",
    ],

    '0.24.0' => [
        "ALTER TABLE  `FormElement` CHANGE  `type`  `type` ENUM(  'checkbox',  'date',  'datetime',  'dateJQW',  'datetimeJQW',  'extra',  'gridJQW',  'text',  'editor',  'time',  'note',  'password',  'radio',  'select',  'subrecord',  'upload', 'annotate',  'fieldset',  'pill',  'templateGroup',  'beforeLoad',  'beforeSave',  'beforeInsert',  'beforeUpdate',  'beforeDelete',  'afterLoad',  'afterSave',  'afterInsert',  'afterUpdate',  'afterDelete',  'sendMail',  'paste' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'text';",
    ],

    '0.25.0' => [
        "ALTER TABLE  `FormElement` CHANGE  `type`  `type` ENUM(  'checkbox',  'date',  'datetime',  'dateJQW',  'datetimeJQW',  'extra',  'gridJQW',  'text',  'editor',  'annotate',  'time',  'note',  'password',  'radio',  'select', 'subrecord',  'upload',  'annotate',  'fieldset',  'pill',  'templateGroup',  'beforeLoad',  'beforeSave',  'beforeInsert',  'beforeUpdate',  'beforeDelete',  'afterLoad',  'afterSave',  'afterInsert',  'afterUpdate',  'afterDelete', 'sendMail',  'paste' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'text';",
    ],

    '0.25.3' => [
        "ALTER TABLE `MailLog` ADD `xId2` INT NOT NULL AFTER `xId`, ADD `xId3` INT NOT NULL AFTER `xId2`",
    ],

    '0.25.7' => [
        "ALTER TABLE `MailLog` CHANGE `attach` `attach` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''",
    ],

    '0.25.10' => [
        "ALTER TABLE  `FormElement` CHANGE  `type`  `type` ENUM(  'checkbox',  'date',  'datetime',  'dateJQW',  'datetimeJQW',  'extra',  'gridJQW',  'text',  'editor',  'annotate',  'imageCut', 'time',  'note',  'password',  'radio',  'select', 'subrecord',  'upload',  'fieldset',  'pill',  'templateGroup',  'beforeLoad',  'beforeSave',  'beforeInsert',  'beforeUpdate',  'beforeDelete',  'afterLoad',  'afterSave',  'afterInsert',  'afterUpdate',  'afterDelete', 'sendMail',  'paste' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'text';",
    ],

    '0.25.11' => [
        "UPDATE `FormElement` SET `checkType` = 'alnumx', checkPattern = '', parameter = CONCAT(parameter, '\nmin = ', SUBSTRING_INDEX(checkPattern, '|', 1), '\nmax = ', SUBSTRING_INDEX(checkPattern, '|', -1)) WHERE checkType LIKE 'min|max%' AND checkPattern <> ''",
        "ALTER TABLE `FormElement` CHANGE `checkType` `checkType` ENUM('alnumx','digit','numerical','email','pattern','allbut','all') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'alnumx';",
    ],

    '0.25.12' => [
        "ALTER TABLE `FormElement` CHANGE `checkType` `checkType` ENUM('auto','alnumx','digit','numerical','email','pattern','allbut','all') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'auto';",
        "ALTER TABLE `FormElement` CHANGE `label` `label` VARCHAR(511) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''",
    ],

    '18.04.0' => [
        "ALTER TABLE IF EXISTS `Cron` ADD IF NOT EXISTS `outputFile` VARCHAR(255) NOT NULL AFTER `comment`",
        "ALTER TABLE IF EXISTS `Cron` ADD IF NOT EXISTS `outputMode` ENUM('overwrite','append') NOT NULL DEFAULT 'append' AFTER `outputFile`",
        "ALTER TABLE IF EXISTS `Cron` ADD IF NOT EXISTS `outputPattern` VARCHAR(255) NOT NULL AFTER `outputMode`",
    ],

    '18.6.0' => [
        "ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('auto', 'client','no','url','url-skip-history','url-sip') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'client'",
        "UPDATE `Form` SET `forwardMode`='auto' WHERE `forwardMode`='client'",
        "ALTER TABLE `Form` CHANGE `forwardMode` `forwardMode` ENUM('auto', 'close', 'no','url','url-skip-history','url-sip') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'auto';",
    ],

    '18.8.2' => [
        "ALTER TABLE `Form` CHANGE `title` `title` VARCHAR(511) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''",
    ],

    '18.9.1' => [
        "ALTER TABLE `Form` ADD `primaryKey` VARCHAR(255) NOT NULL DEFAULT '' AFTER `tableName`",
    ],

    '18.10.2' => [
        "ALTER TABLE `MailLog` ADD `cc` TEXT NOT NULL AFTER `receiver`, ADD `bcc` TEXT NOT NULL AFTER `cc`;",
    ],

    '19.1.2' => [
        "ALTER TABLE `Form` ADD `labelAlign` ENUM('default','left','center','right') NOT NULL DEFAULT 'default' AFTER `forwardPage`;",
        "ALTER TABLE `FormElement` ADD `labelAlign` ENUM('default','left','center','right') NOT NULL DEFAULT 'default' AFTER `maxLength`;",
    ],

    '19.2.3' => [
        "ALTER TABLE `Form` ADD `restMethod` SET('get','post','put','delete') NOT NULL DEFAULT '' AFTER `permitEdit`; ",
    ],

    '19.3.2' => [
        "ALTER TABLE  `Form` CHANGE  `forwardMode`  `forwardMode` ENUM('auto','close','no','url','url-skip-history','url-sip','url-sip-skip-history' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'auto';",
        "UPDATE `Form` SET `forwardMode`='url-sip-skip-history' WHERE `forwardMode`='url-sip'",
    ],

    '19.7.2' => [
        "ALTER TABLE `Form` CHANGE `forwardPage` `forwardPage` VARCHAR(511) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';",
    ],

    '19.9.1' => [
        "ALTER TABLE IF EXISTS `Cron` ADD IF NOT EXISTS `xId` INT(11) NOT NULL DEFAULT 0 AFTER `grId`; ",
        "ALTER TABLE IF EXISTS `Cron` ADD IF NOT EXISTS `autoGenerated` ENUM('yes','no') NOT NULL DEFAULT 'no' AFTER `outputPattern`; ",
    ],

    '19.11.2' => [
        "ALTER TABLE `Form` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE `Form` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE `FormElement` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE `FormElement` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE `Dirty` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE `Dirty` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE `MailLog` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE `MailLog` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE IF EXISTS `Clipboard` CHANGE IF EXISTS `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE IF EXISTS `Clipboard` CHANGE IF EXISTS `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE IF EXISTS `Split` CHANGE IF EXISTS `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE IF EXISTS `Split` CHANGE IF EXISTS `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",

        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
    ],

    '19.12.0' => [
        "ALTER TABLE `Dirty` ADD `tabUniqId` VARCHAR(32) NOT NULL AFTER `recordHashMd5`;",
    ],

    '20.6.0' => [
        "ALTER TABLE `Form` CHANGE `title` `title` VARCHAR(1023) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `label` `label` VARCHAR(1023) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';",
    ],

    '21.2.0' => [
        "ALTER TABLE `Form` ADD `fileStats` VARCHAR(255) NOT NULL DEFAULT '' AFTER `deleted`;",
        "ALTER TABLE `MailLog` CHANGE `header` `header` VARCHAR(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';",
        "ALTER TABLE `MailLog` CHANGE `attach` `attach` VARCHAR(4096) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';",
    ],

    '21.4.0' => [
        "ALTER TABLE `FormSubmitLog` ADD `formName`  VARCHAR(255) NOT NULL DEFAULT '' AFTER `formId`;",
    ],

    '21.6.0' => [
        "ALTER TABLE `FormElement` CHANGE `encode` `encode` ENUM('none','specialchar','single tick') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'specialchar';",
    ],

    '22.6.0' => [
        "ALTER TABLE `FormElement` ADD `encryption`  ENUM('yes','no') NOT NULL DEFAULT 'no' AFTER `dynamicUpdate`;",
        "ALTER TABLE `FormElement` ADD `encryptionMethod`  ENUM('Default', 'AES-128','AES-256') NOT NULL DEFAULT 'Default' AFTER `encryption`;",
    ],

    '22.8.1' => [
        "ALTER TABLE `FormElement` CHANGE `formId` `formId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE `Dirty` CHANGE `recordId` `recordId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE `FormSubmitLog` CHANGE `formId` `formId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE `FormSubmitLog` CHANGE `recordId` `recordId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `grId` `grId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `xId` `xId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE IF EXISTS `Split` CHANGE IF EXISTS `xId` `xId` INT(11) NOT NULL DEFAULT '0';",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `public` `public` TINYINT(1) NOT NULL DEFAULT '0';",
    ],

    '23.6.0' => [
        "ALTER TABLE `FormSubmitLog` ADD INDEX IF NOT EXISTS `createdFeUserFormId` (`created`, `feUser`, `formId`);",
    ],

    '23.11.0' => [
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `lastStatus` `lastStatus` text NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `frequency` `frequency` varchar(32) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `sql1` `sql1` text NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `content` `content` text NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `comment` `comment` text NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `outputFile` `outputFile` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Cron` CHANGE IF EXISTS `outputPattern` `outputPattern` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `sip` `sip` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `tableName` `tableName` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `expire` `expire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';",
        "ALTER TABLE `Dirty` CHANGE `recordHashMd5` `recordHashMd5` char(32) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `tabUniqId` `tabUniqId` char(32) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `feUser` `feUser` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `qfqUserSessionCookie` `qfqUserSessionCookie` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE `Dirty` CHANGE `remoteAddress` `remoteAddress` varchar(45) NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `noteInternal` `noteInternal` text NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `multiSql` `multiSql` text NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `parameter` `parameter` text NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `parameterLanguageA` `parameterLanguageA` text NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `parameterLanguageB` `parameterLanguageB` text NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `parameterLanguageC` `parameterLanguageC` text NOT NULL DEFAULT '';",
        "ALTER TABLE `Form` CHANGE `parameterLanguageD` `parameterLanguageD` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `modeSql` `modeSql` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `note` `note` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `adminNote` `adminNote` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `value` `value` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `sql1` `sql1` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `parameter` `parameter` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `parameterLanguageA` `parameterLanguageA` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `parameterLanguageB` `parameterLanguageB` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `parameterLanguageC` `parameterLanguageC` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `parameterLanguageD` `parameterLanguageD` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormElement` CHANGE `clientJs` `clientJs` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `formData` `formData` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `sipData` `sipData` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `clientIp` `clientIp` varchar(64) NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `feUser` `feUser` varchar(64) NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `userAgent` `userAgent` text NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `formName` `formName` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE `FormSubmitLog` CHANGE `pageId` `pageId` int(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE `FormSubmitLog` CHANGE `sessionId` `sessionId` varchar(32) NOT NULL DEFAULT '';",
        "ALTER TABLE `MailLog` CHANGE `receiver` `receiver` text NOT NULL DEFAULT '';",
        "ALTER TABLE `MailLog` CHANGE `cc` `cc` text NOT NULL DEFAULT '';",
        "ALTER TABLE `MailLog` CHANGE `bcc` `bcc` text NOT NULL DEFAULT '';",
        "ALTER TABLE `MailLog` CHANGE `body` `body` text NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `type` `type` enum('','tablesorter') NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `name` `name` varchar(64) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `feUser` `feUser` varchar(32) NOT NULL DEFAULT '' COMMENT 'In case there is no logged in user, take QFQ cookie.';",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `tableId` `tableId` varchar(64) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Setting` CHANGE IF EXISTS `view` `view` text NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Split` CHANGE IF EXISTS `tableName` `tableName` varchar(255) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Split` CHANGE IF EXISTS `pathFileName` `pathFileName` varchar(255) NOT NULL DEFAULT '';",
    ],

    '24.3.0' => [
        "ALTER TABLE IF EXISTS `FileUpload` CHANGE IF EXISTS `type` `mimeType` VARCHAR(64) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `FileUpload` CHANGE IF EXISTS `size` `fileSize` VARCHAR(32) NOT NULL DEFAULT '0';",
    ],

    '24.12.0' => [
        "ALTER TABLE `Form` CHANGE `title` `title` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';",
    ],

    '25.6.0' => [
        "ALTER TABLE `Form` CHANGE `showButton` `showButton` SET('new','delete','close','save','note','issue') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new,delete,close,save';",
        "UPDATE `Form` SET `showButton` = REPLACE(`showButton`, 'note', 'issue') WHERE FIND_IN_SET('note', `showButton`);",
        "ALTER TABLE `Form` CHANGE `showButton` `showButton` SET('new','delete','close','save','issue') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new,delete,close,save';",
        "ALTER TABLE IF EXISTS `Glue` ADD IF NOT EXISTS `xId2` INT(11) NOT NULL DEFAULT 0 AFTER `xId`;",
        "ALTER TABLE IF EXISTS `Glue` ADD IF NOT EXISTS `pId` INT(11) NOT NULL DEFAULT 0 AFTER `xId2`;",
        "ALTER TABLE IF EXISTS `Glue` ADD IF NOT EXISTS `pId2` INT(11) NOT NULL DEFAULT 0 AFTER `pId`;",
        "ALTER TABLE IF EXISTS `FileUpload` ADD IF NOT EXISTS `pathFileNameNote` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Optional comment' AFTER  `pathFileName` ;",
        "ALTER TABLE IF EXISTS `FileUpload` ADD IF NOT EXISTS `pId` INT(11) NOT NULL DEFAULT 0 AFTER `xId`;",
        "UPDATE `FormElement` SET `type` = 'note', `enabled`='no' WHERE FIND_IN_SET(type, 'dateJQW,datetimeJQW,gridJQW');",
        "ALTER TABLE `FormElement` CHANGE `type` `type` ENUM('colorPicker','chat','checkbox','date','datetime','extra','text','editor','annotate','imageCut','time','note','password','radio','select','subrecord','upload','fieldset','pill','templateGroup','beforeLoad','beforeSave','beforeInsert','beforeUpdate','beforeDelete','afterLoad','afterSave','afterInsert','afterUpdate','afterDelete','sendMail','paste') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text';",
    ],

    '25.8.0' => [
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `isId` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `pIdCreator` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `comment` TEXT NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `accessContact` ENUM('yes', 'no') NOT NULL DEFAULT 'yes';",
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `mailNotificationSet` VARCHAR(1024) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `mailNotification` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';",
        "ALTER TABLE IF EXISTS `Comment` ADD IF NOT EXISTS `deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no';",

        "ALTER TABLE IF EXISTS `Comment` CHANGE IF EXISTS `grId` `grId_unused` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Comment` CHANGE IF EXISTS `xId` `xId_unused` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Comment` CHANGE IF EXISTS `pId` `pId_unused` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Comment` CHANGE IF EXISTS `value` `value_unused` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Project` ADD IF NOT EXISTS `prId` INT(11) NOT NULL DEFAULT 0;",
        "ALTER TABLE IF EXISTS `Issue` CHANGE IF EXISTS `mailWatcherNotifySet` `mailNotificationSet` VARCHAR(1024) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Issue` ADD IF NOT EXISTS `mailNotification` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';",
        "ALTER TABLE IF EXISTS `Issue` ADD IF NOT EXISTS `accessContact` ENUM ('yes','no') NOT NULL DEFAULT 'yes';",

        "ALTER TABLE IF EXISTS `Issue` CHANGE IF EXISTS `mailContactNotify` `mailContactNotify_unused` VARCHAR(255) NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Issue` CHANGE IF EXISTS `access` `access_unused` ENUM('private', 'public', 'project') NOT NULL DEFAULT 'project';",

        "ALTER TABLE IF EXISTS `Setting` CHANGE `type` `type` ENUM('','tablesorter','notification','notification-popup','email', 'credentials') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '';",
        "ALTER TABLE IF EXISTS `Setting` ADD `name2` VARCHAR(64) NOT NULL DEFAULT '' AFTER `name`; "
    ],

    '26.1.0' => [
        "ALTER TABLE `FormElement` CHANGE `type` `type` ENUM('colorPicker','chat','checkbox','date','datetime','extra','text','editor','annotate','imageCut','inputCollectionJson','time','note','password','radio','select','subrecord','upload','fieldset','pill','templateGroup','beforeLoad','beforeSave','beforeInsert','beforeUpdate','beforeDelete','afterLoad','afterSave','afterInsert','afterUpdate','afterDelete','sendMail','paste') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text';",
    ],

    '26.1.2' => [
        "ALTER TABLE IF EXISTS `DeployRef` ADD COLUMN `potentiallyDeleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Flag: srcId not in last export, possibly deleted on source' AFTER `ruleId`;"
    ]

//    Note: ALWAYS add '...  IF EXISTS ...' for optional tables (most QFQ tables are optional)! If not, QFQ will ask to create them on the next QFQ update.

//    'new version' => [
//
//    ]
);