 ,`subtask_max_value` tinyint(4)
 ,`subtask_inflation_rate` decimal(4,1)
 ,`subtask_demand_cutoff` tinyint(4)
+,`subtask_bonus_base` tinyint(4)
 ,`subtask_description` mediumtext
 ,`subtask_url` varchar(48)
 ,`subtask_accumulative` tinyint(4)

--
DROP TABLE IF EXISTS `lc60_calculated_subtask_demand_inner`;

CREATE ALGORITHM=UNDEFINED DEFINER=`tggtt`@`localhost` SQL SECURITY DEFINER VIEW `lc60_calculated_subtask_demand_inner` AS select `calculated_subtask_demand_union`.`current_task_id` AS `current_task_id`,`calculated_subtask_demand_union`.`contemporary_task_id` AS `contemporary_task_id`,`calculated_subtask_demand_union`.`subtask_id` AS `subtask_id`,`calculated_subtask_demand_union`.`subtask_starting_demand` AS `subtask_starting_demand`,`calculated_subtask_demand_union`.`subtask_success_count` AS `subtask_success_count`,`calculated_subtask_demand_union`.`subtask_success_count_total` AS `subtask_success_count_total`,`calculated_subtask_demand_union`.`subtask_task_period_demand` AS `subtask_task_period_demand`,`calculated_subtask_demand_union`.`subtask_task_id` AS `subtask_task_id`,`calculated_subtask_demand_union`.`subtask_super_id` AS `subtask_super_id`,`calculated_subtask_demand_union`.`subtask_name` AS `subtask_name`,`calculated_subtask_demand_union`.`subtask_category_id` AS `subtask_category_id`,`calculated_subtask_demand_union`.`subtask_base_value` AS `subtask_base_value`,`calculated_subtask_demand_union`.`subtask_max_value` AS `subtask_max_value`,`calculated_subtask_demand_union`.`subtask_inflation_rate` AS `subtask_inflation_rate`,`calculated_subtask_demand_union`.`subtask_demand_cutoff` AS `subtask_demand_cutoff`,`calculated_subtask_demand_union`.`subtask_description` AS `subtask_description`,`calculated_subtask_demand_union`.`subtask_url` AS `subtask_url`,`calculated_subtask_demand_union`.`subtask_accumulative` AS `subtask_accumulative`,`calculated_subtask_demand_union`.`subtask_owner_participant_id` AS `subtask_owner_participant_id`,`calculated_subtask_demand_union`.`subtask_dividend_rate` AS `subtask_dividend_rate`,`calculated_subtask_demand_union`.`subtask_category_name` AS `subtask_category_name`,`calculated_subtask_demand_union`.`subtask_category_class` AS `subtask_category_class`,`calculated_subtask_demand_union`.`subtask_category_description` AS `subtask_category_description`,`calculated_subtask_demand_union`.`contemporary_demand` AS `contemporary_demand`,`calculated_subtask_demand_union`.`contemporary_demand_positive` AS `contemporary_demand_positive`,(case when (isnull(`calculated_subtask_demand_union`.`subtask_max_value`) or isnull(`calculated_subtask_demand_union`.`subtask_starting_demand`)) then 0 else (pow(`calculated_subtask_demand_union`.`contemporary_demand_positive`,(`calculated_subtask_demand_union`.`subtask_inflation_rate` / 100)) / `calculated_subtask_demand_union`.`subtask_demand_cutoff`) end) AS `inner_function` from `lc60_calculated_subtask_demand_union` `calculated_subtask_demand_union`;

-- --------------------------------------------------------


,`subtask_success_count_total` bigint(21)
,`contemporary_demand` decimal(44,0)
,`contemporary_demand_positive` decimal(44,0)
,`inner_function` decimal(44,0)
,`external_function` decimal(47,0)
,`final_value` decimal(48,0)
,`final_value_truncate` decimal(50,2)
,`subtask_dividend_rate` decimal(4,1)
);

