DatabaseUpdateData.php 6.78 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?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' => [
Carsten  Rose's avatar
Carsten Rose committed
18
        "ALTER TABLE FormElement MODIFY COLUMN checkType ENUM('alnumx','digit','numerical','email','min|max','min|max date', 'pattern','allbut','all') NOT NULL DEFAULT 'alnumx' ",
19
20
21
    ],

    '0.14.0' => [
Carsten  Rose's avatar
Carsten Rose committed
22
        "ALTER TABLE `FormElement` CHANGE `placeholder` `placeholder` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ",
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    ],

    '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 INDEX `feGroup` (`feGroup`)",
        "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'",

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

Carsten  Rose's avatar
Carsten Rose committed
45
    '0.18.0' => [
46
47
48
49
50
        "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'",
    ],

Carsten  Rose's avatar
Carsten Rose committed
51
52
53
54
    '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';",
    ],
Carsten  Rose's avatar
Carsten Rose committed
55
56
57

    '0.19.0' => [
        "ALTER TABLE  `Form` ADD  `dirtyMode` ENUM( 'exclusive', 'advisory', 'none' ) NOT NULL DEFAULT  'exclusive' AFTER  `requiredParameter`",
58
59
        "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;",
60
        "INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());"
Carsten  Rose's avatar
Carsten Rose committed
61
    ],
Carsten  Rose's avatar
Carsten Rose committed
62

63
    '0.19.5' => [
64
65
66
67
68
69
70
71
        "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`",
72
        "ALTER TABLE `FormElement` ADD `parameterLanguageD` TEXT NOT NULL AFTER `parameterLanguageC`",
Carsten  Rose's avatar
Carsten Rose committed
73
74
    ],

75
76
77
78
79
80
    '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",
    ],

81
82
83
    '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';",
    ],
Carsten  Rose's avatar
Carsten Rose committed
84
85
86
87

    '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';",
    ],
88
89
90
91
92

    '0.26.0' => [
        "ALTER TABLE  `Form` CHANGE  `escapeTypeDefault`  `escapeTypeDefault` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  'm'",
        "UPDATE Form SET escapeTypeDefault =  'm' WHERE escapeTypeDefault =  'c'",
    ],
93
94
95
96
);