Refactored Custom Form Table Structure

This commit is contained in:
witzig 2017-03-20 19:37:09 +01:00
parent 477aff95d5
commit c3ee53bd4b
3 changed files with 178 additions and 84 deletions

View file

@ -10,27 +10,38 @@ CREATE TABLE `custom_forms` (
`description` text,
`fields_shown_on_subscribe` varchar(255) DEFAULT '',
`fields_shown_on_manage` varchar(255) DEFAULT '',
`layout` mediumtext,
`form_input_style` mediumtext,
`mail_confirm_html` text,
`mail_confirm_text` text,
`mail_subscription_confirmed_html` text,
`mail_subscription_confirmed_text` text,
`mail_unsubscribe_confirmed_html` text,
`mail_unsubscribe_confirmed_text` text,
`web_confirm_notice` text,
`web_manage_address` text,
`web_manage` text,
`web_subscribe` text,
`web_subscribed` text,
`web_unsubscribe_notice` text,
`web_unsubscribe` text,
`web_updated_notice` text,
`layout` longtext,
`form_input_style` longtext,
`mail_confirm_html` int(11) unsigned DEFAULT NULL,
`mail_confirm_text` int(11) unsigned DEFAULT NULL,
`mail_subscription_confirmed_html` int(11) unsigned DEFAULT NULL,
`mail_subscription_confirmed_text` int(11) unsigned DEFAULT NULL,
`mail_unsubscribe_confirmed_html` int(11) unsigned DEFAULT NULL,
`mail_unsubscribe_confirmed_text` int(11) unsigned DEFAULT NULL,
`web_confirm_notice` int(11) unsigned DEFAULT NULL,
`web_manage_address` int(11) unsigned DEFAULT NULL,
`web_manage` int(11) unsigned DEFAULT NULL,
`web_subscribe` int(11) unsigned DEFAULT NULL,
`web_subscribed` int(11) unsigned DEFAULT NULL,
`web_unsubscribe_notice` int(11) unsigned DEFAULT NULL,
`web_unsubscribe` int(11) unsigned DEFAULT NULL,
`web_updated_notice` int(11) unsigned DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `list` (`list`),
CONSTRAINT `custom_forms_ibfk_1` FOREIGN KEY (`list`) REFERENCES `lists` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Create table to store custom form data
CREATE TABLE `custom_forms_data` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`form` int(11) unsigned NOT NULL,
`data_key` varchar(255) DEFAULT '',
`data_value` longtext,
PRIMARY KEY (`id`),
KEY `form` (`form`),
CONSTRAINT `custom_forms_data_ibfk_1` FOREIGN KEY (`form`) REFERENCES `custom_forms` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
# Add default_form to lists
ALTER TABLE `lists` ADD COLUMN `default_form` int(11) unsigned DEFAULT NULL AFTER `cid`;