# Linea21 DB patch - UTF-8 format
# patch v2.1.x To v2.2


# ************** Warning **************
# Apply previous patch to Linea21, before applying this one

# Adding vote tables
CREATE TABLE `l21_vote` ( `vote_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `vote_module` varchar(100) NOT NULL, `vote_module_id` varchar(255) NOT NULL, `vote_user_id` int(11) NOT NULL, `vote_user_ip` varchar(100) NOT NULL, `vote_date_crea` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY (`vote_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

# We add extra field for operational goal in project module
ALTER TABLE `l21_project` ADD `project_opgoal` TEXT CHARACTER SET utf8mb4 NULL DEFAULT NULL AFTER `project_goal`;

# because of image base64 encoded text field is not big enough for eq_htmlbody in l21_email_queue - Change type to MEDIUMTEXT - see issue #970 http://dev.linea21.com/issues/970
ALTER TABLE `l21_email_queue` CHANGE `eq_htmlbody` `eq_htmlbody` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;