Commit 8c5a4d37 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Change definition of QFQ system tables for 'modified' and 'created'. Use...

Change definition of QFQ system tables for 'modified' and 'created'. Use DATETIME instead of TIMESTAMP
parent ce1d6224
Pipeline #2697 passed with stages
in 3 minutes and 2 seconds
......@@ -159,6 +159,32 @@ $UPDATE_ARRAY = array(
"ALTER TABLE `Cron` ADD `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 `Clipboard` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Clipboard` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Cron` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Cron` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Split` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Split` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Setting` CHANGE `modified` `modified` DATETIME on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
"ALTER TABLE `Setting` CHANGE `created` `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; ",
],
);
......
......@@ -3,9 +3,9 @@ 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,
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `start` (`start`)
)
......
......@@ -36,15 +36,14 @@ CREATE TABLE IF NOT EXISTS `Form`
`parameter` TEXT NOT NULL,
`parameterLanguageA` TEXT NOT NULL,
`parameterLanguageB` TEXT NOT NULL,
`parameterLanguageC` TEXT NOT NULL,
`parameterLanguageD` TEXT NOT NULL,
`recordLockTimeoutSeconds` INT(11) NOT NULL DEFAULT 900,
`parameterLanguageB` TEXT NOT NULL,
`parameterLanguageC` TEXT NOT NULL,
`parameterLanguageD` TEXT NOT NULL,
`recordLockTimeoutSeconds` INT(11) NOT NULL DEFAULT 900,
`deleted` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`deleted` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `name` (`name`),
......@@ -57,46 +56,46 @@ CREATE TABLE IF NOT EXISTS `Form`
CREATE TABLE IF NOT EXISTS `FormElement`
(
`id` INT(11) NOT NULL AUTO_INCREMENT,
`formId` INT(11) NOT NULL,
`feIdContainer` INT(11) NOT NULL DEFAULT '0',
`dynamicUpdate` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`enabled` ENUM ('yes', 'no') NOT NULL DEFAULT 'yes',
`name` VARCHAR(255) NOT NULL DEFAULT '',
`label` VARCHAR(511) NOT NULL DEFAULT '',
`mode` ENUM ('show', 'required', 'readonly', 'hidden') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM ('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM ('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text',
'editor', 'annotate', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload',
'annotate', 'imageCut', 'fieldset', 'pill', 'templateGroup',
'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad',
'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', 'sendMail',
'paste') NOT NULL DEFAULT 'text',
`subrecordOption` SET ('edit', 'delete', 'new') NOT NULL DEFAULT '',
`encode` ENUM ('none', 'specialchar') NOT NULL DEFAULT 'specialchar',
`checkType` ENUM ('auto', 'alnumx', 'digit', 'numerical', 'email', 'pattern', 'allbut',
'all') NOT NULL DEFAULT 'auto',
`checkPattern` VARCHAR(255) NOT NULL DEFAULT '',
`onChange` VARCHAR(255) NOT NULL DEFAULT '',
`ord` INT(11) NOT NULL DEFAULT '0',
`tabindex` INT(11) NOT NULL DEFAULT '0',
`size` VARCHAR(255) NOT NULL DEFAULT '',
`maxLength` VARCHAR(255) NOT NULL DEFAULT '',
`labelAlign` ENUM ('default', 'left', 'center', 'right') NOT NULL DEFAULT 'default',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsInputColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '',
`rowLabelInputNote` SET ('row', 'label', '/label', 'input', '/input', 'note', '/note', '/row') NOT NULL DEFAULT 'row,label,/label,input,/input,note,/note,/row',
`note` TEXT NOT NULL,
`adminNote` TEXT NOT NULL,
`tooltip` VARCHAR(255) NOT NULL DEFAULT '',
`id` INT(11) NOT NULL AUTO_INCREMENT,
`formId` INT(11) NOT NULL,
`feIdContainer` INT(11) NOT NULL DEFAULT '0',
`dynamicUpdate` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`enabled` ENUM ('yes', 'no') NOT NULL DEFAULT 'yes',
`name` VARCHAR(255) NOT NULL DEFAULT '',
`label` VARCHAR(511) NOT NULL DEFAULT '',
`mode` ENUM ('show', 'required', 'readonly', 'hidden') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM ('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM ('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text',
'editor', 'annotate', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload',
'annotate', 'imageCut', 'fieldset', 'pill', 'templateGroup',
'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad',
'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', 'sendMail',
'paste') NOT NULL DEFAULT 'text',
`subrecordOption` SET ('edit', 'delete', 'new') NOT NULL DEFAULT '',
`encode` ENUM ('none', 'specialchar') NOT NULL DEFAULT 'specialchar',
`checkType` ENUM ('auto', 'alnumx', 'digit', 'numerical', 'email', 'pattern', 'allbut',
'all') NOT NULL DEFAULT 'auto',
`checkPattern` VARCHAR(255) NOT NULL DEFAULT '',
`onChange` VARCHAR(255) NOT NULL DEFAULT '',
`ord` INT(11) NOT NULL DEFAULT '0',
`tabindex` INT(11) NOT NULL DEFAULT '0',
`size` VARCHAR(255) NOT NULL DEFAULT '',
`maxLength` VARCHAR(255) NOT NULL DEFAULT '',
`labelAlign` ENUM ('default', 'left', 'center', 'right') NOT NULL DEFAULT 'default',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsInputColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '',
`rowLabelInputNote` SET ('row', 'label', '/label', 'input', '/input', 'note', '/note', '/row') NOT NULL DEFAULT 'row,label,/label,input,/input,note,/note,/row',
`note` TEXT NOT NULL,
`adminNote` TEXT NOT NULL,
`tooltip` VARCHAR(255) NOT NULL DEFAULT '',
`placeholder` VARCHAR(2048) NOT NULL DEFAULT '',
`value` TEXT NOT NULL,
......@@ -110,9 +109,8 @@ CREATE TABLE IF NOT EXISTS `FormElement`
`feGroup` VARCHAR(255) NOT NULL DEFAULT '',
`deleted` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `formId` (`formId`),
......@@ -139,9 +137,9 @@ CREATE TABLE IF NOT EXISTS `Dirty`
`qfqUserSessionCookie` VARCHAR(255) NOT NULL,
`dirtyMode` ENUM ('exclusive', 'advisory', 'none') NOT NULL DEFAULT 'exclusive',
`remoteAddress` VARCHAR(45) NOT NULL,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL,
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `sip` (`sip`),
KEY `tableName` (`tableName`),
......@@ -525,8 +523,8 @@ CREATE TABLE IF NOT EXISTS `MailLog`
`header` VARCHAR(255) NOT NULL DEFAULT '',
`attach` VARCHAR(1024) NOT NULL DEFAULT '',
`src` VARCHAR(255) NOT NULL DEFAULT '',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
......@@ -564,9 +562,8 @@ CREATE TABLE IF NOT EXISTS `Clipboard`
`formIdPaste` INT(11) NOT NULL DEFAULT '0',
`idSrc` INT(11) NOT NULL DEFAULT '0',
`xId` INT(11) NOT NULL DEFAULT '0',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
......@@ -615,9 +612,9 @@ CREATE TABLE IF NOT EXISTS `Cron`
`outputMode` ENUM ('overwrite', 'append') NOT NULL DEFAULT 'append',
`outputPattern` VARCHAR(255) NOT NULL,
`autoGenerated` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
......@@ -678,9 +675,9 @@ CREATE TABLE IF NOT EXISTS `Split`
`tableName` VARCHAR(255) NOT NULL,
`xId` INT(11) NOT NULL,
`pathFileName` VARCHAR(255) NOT NULL,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
......@@ -689,16 +686,16 @@ CREATE TABLE IF NOT EXISTS `Split`
CREATE TABLE IF NOT EXISTS `Setting`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` enum ('', 'tablesorter') NOT NULL,
`readonly` enum ('yes', 'no') NOT NULL DEFAULT 'no' COMMENT 'Settings can''t be modified.',
`name` varchar(64) NOT NULL,
`public` tinyint(1) NOT NULL,
`feUser` varchar(32) NOT NULL COMMENT 'In case there is no logged in user, take QFQ cookie.',
`tableId` varchar(64) NOT NULL,
`view` text NOT NULL,
`modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`id` INT(11) NOT NULL AUTO_INCREMENT,
`type` ENUM ('', 'tablesorter') NOT NULL,
`readonly` ENUM ('yes', 'no') NOT NULL DEFAULT 'no' COMMENT 'Settings can''t be modified.',
`name` VARCHAR(64) NOT NULL,
`public` TINYINT(1) NOT NULL,
`feUser` VARCHAR(32) NOT NULL COMMENT 'In case there is no logged in user, take QFQ cookie.',
`tableId` VARCHAR(64) NOT NULL,
`view` TEXT NOT NULL,
`modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `name` (`name`),
KEY `typeFeUserUidTableIdPublic` (`type`, `feUser`, `tableId`, `public`) USING BTREE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment