START TRANSACTION;

ALTER TABLE `meal`
	ADD COLUMN `normalized_name` CHAR(100) NOT NULL DEFAULT '0' AFTER `name`,
	ADD COLUMN `serving` DOUBLE(10,2) NULL DEFAULT '0.00' AFTER `quantity_unit`,
	ADD COLUMN `serving_unit` CHAR(50) NULL DEFAULT '' AFTER `portion`;

ALTER TABLE `diet_meal`
	ADD COLUMN `normalized_name` CHAR(100) NOT NULL DEFAULT '0' AFTER `meal_name`,
	ADD COLUMN `serving` DOUBLE(10,2) NULL DEFAULT '0.00' AFTER `quantity_unit`,
	ADD COLUMN `serving_unit` CHAR(50) NULL DEFAULT '' AFTER `portion`;

ALTER TABLE `recipe_meal`
	CHANGE COLUMN `quantity` `quantity` DOUBLE NULL DEFAULT NULL AFTER `recipe_id`,
	ADD COLUMN `quantity_unit` CHAR(50) NULL DEFAULT NULL AFTER `quantity`;

UPDATE configuration set config_value = "1.2.3", date_change=CURRENT_DATE WHERE config_key = "db_version";

COMMIT;