Skip to content
Snippets Groups Projects
Commit 1e24585c authored by Jared Hancock's avatar Jared Hancock
Browse files

Add database migration for custom list properties

parent fd97da77
No related branches found
No related tags found
No related merge requests found
......@@ -906,7 +906,7 @@ class DynamicListItem extends VerySimpleModel {
function getConfiguration() {
if (!$this->_config) {
$this->_config = $this->get('configuration');
$this->_config = $this->get('properties');
if (is_string($this->_config))
$this->_config = JsonDataParser::parse($this->_config);
elseif (!$this->_config)
......@@ -922,7 +922,7 @@ class DynamicListItem extends VerySimpleModel {
$errors = array_merge($errors, $field->errors());
}
if (count($errors) === 0)
$this->set('configuration', JsonDataEncoder::encode($config));
$this->set('properties', JsonDataEncoder::encode($config));
return count($errors) === 0;
}
......
4323a6a81c35efbf7722b7fc4e475440
0217a4299f37124fb4fb352635bae1b4
/**
* @version v1.8.2
* @signature 4323a6a81c35efbf7722b7fc4e475440
* @signature 0217a4299f37124fb4fb352635bae1b4
* @title Add client login feature
*
*/
......@@ -116,7 +116,13 @@ UPDATE `%TABLE_PREFIX%content` SET `content_id` = LAST_INSERT_ID()
DELETE FROM `%TABLE_PREFIX%email_template`
WHERE `code_name` IN ('staff.pwreset', 'user.accesslink');
ALTER TABLE `%TABLE_PREFIX%form`
CHANGE `type` `type` varchar(8) NOT NULL DEFAULT 'G';
ALTER TABLE `%TABLE_PREFIX%list_items`
ADD `properties` text AFTER `sort`;
-- Finished with patch
UPDATE `%TABLE_PREFIX%config`
SET `value` = '4323a6a81c35efbf7722b7fc4e475440'
SET `value` = '0217a4299f37124fb4fb352635bae1b4'
WHERE `key` = 'schema_signature' AND `namespace` = 'core';
......@@ -96,7 +96,7 @@ INSERT INTO `%TABLE_PREFIX%config` (`namespace`, `key`, `value`) VALUES
DROP TABLE IF EXISTS `%TABLE_PREFIX%form`;
CREATE TABLE `%TABLE_PREFIX%form` (
`id` int(11) unsigned NOT NULL auto_increment,
`type` char(1) NOT NULL DEFAULT 'G',
`type` varchar(8) NOT NULL DEFAULT 'G',
`deletable` tinyint(1) NOT NULL DEFAULT 1,
`title` varchar(255) NOT NULL,
`instructions` varchar(512),
......@@ -167,6 +167,7 @@ CREATE TABLE `%TABLE_PREFIX%list_items` (
-- extra value such as abbreviation
`extra` varchar(255),
`sort` int(11) NOT NULL DEFAULT 1,
`properties` text,
PRIMARY KEY (`id`),
KEY `list_item_lookup` (`list_id`)
) DEFAULT CHARSET=utf8;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment