   `subtask_base_value` tinyint(4) NOT NULL COMMENT 'score base.',
   `subtask_max_value` tinyint(4) DEFAULT NULL COMMENT 'Max value used to be DEFAULT ''20''',
   `subtask_starting_demand` tinyint(4) NOT NULL DEFAULT '0',
-  `subtask_inflation_rate` decimal(4,1) NOT NULL DEFAULT '102.0',
+  `subtask_inflation_rate` decimal(4,1) NOT NULL DEFAULT '102.0' COMMENT 'Deprecated.',
   `subtask_demand_cutoff` tinyint(4) NOT NULL DEFAULT '7',
+  `subtask_bonus_base` tinyint(4) NOT NULL DEFAULT '0',
   `subtask_description` tinytext,
   `subtask_url` varchar(48) DEFAULT NULL,
   `subtask_accumulative` tinyint(1) NOT NULL DEFAULT '0',

--
DROP TABLE IF EXISTS `lc60_demand_view_success_contemporary_demand`;

CREATE ALGORITHM=UNDEFINED DEFINER=`tggtt`@`localhost` SQL SECURITY DEFINER VIEW `lc60_demand_view_success_contemporary_demand` AS select `current_task`.`task_id` AS `current_task_id`,`demand_view_success`.`contemporary_task_id` AS `contemporary_task_id`,`demand_view_success`.`subtask_id` AS `subtask_id`,`demand_view_success`.`subtask_starting_demand` AS `subtask_starting_demand`,`demand_view_success`.`subtask_success_count` AS `subtask_success_count`,`demand_view_success`.`subtask_success_count_total` AS `subtask_success_count_total`,`demand_view_success`.`subtask_task_period_demand` AS `subtask_task_period_demand`,`demand_view_success`.`subtask_task_id` AS `subtask_task_id`,`demand_view_success`.`subtask_super_id` AS `subtask_super_id`,`demand_view_success`.`subtask_name` AS `subtask_name`,`demand_view_success`.`subtask_category_id` AS `subtask_category_id`,`demand_view_success`.`subtask_base_value` AS `subtask_base_value`,`demand_view_success`.`subtask_max_value` AS `subtask_max_value`,`demand_view_success`.`subtask_inflation_rate` AS `subtask_inflation_rate`,`demand_view_success`.`subtask_demand_cutoff` AS `subtask_demand_cutoff`,`demand_view_success`.`subtask_description` AS `subtask_description`,`demand_view_success`.`subtask_url` AS `subtask_url`,`demand_view_success`.`subtask_accumulative` AS `subtask_accumulative`,`demand_view_success`.`subtask_owner_participant_id` AS `subtask_owner_participant_id`,`demand_view_success`.`subtask_dividend_rate` AS `subtask_dividend_rate`,`demand_view_success`.`subtask_category_name` AS `subtask_category_name`,`demand_view_success`.`subtask_category_class` AS `subtask_category_class`,`demand_view_success`.`subtask_category_description` AS `subtask_category_description`,(((`demand_view_success`.`subtask_task_period_demand` * (`demand_view_success`.`contemporary_task_id` - `current_task`.`task_id`)) - `demand_view_success`.`subtask_success_count`) + `demand_view_success`.`subtask_starting_demand`) AS `contemporary_demand` from (`lc60_current_task` `current_task` join `lc60_demand_view_success` `demand_view_success`) group by `current_task`.`task_id`,`demand_view_success`.`contemporary_task_id`,`demand_view_success`.`subtask_id`,`demand_view_success`.`subtask_starting_demand`,`demand_view_success`.`subtask_success_count`,`demand_view_success`.`subtask_task_period_demand`,`demand_view_success`.`subtask_task_id`,`demand_view_success`.`subtask_super_id`,`demand_view_success`.`subtask_name`,`demand_view_success`.`subtask_category_id`,`demand_view_success`.`subtask_base_value`,`demand_view_success`.`subtask_max_value`,`demand_view_success`.`subtask_inflation_rate`,`demand_view_success`.`subtask_demand_cutoff`,`demand_view_success`.`subtask_url`,`demand_view_success`.`subtask_accumulative`,`demand_view_success`.`subtask_owner_participant_id`,`demand_view_success`.`subtask_dividend_rate`;

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


--
DROP TABLE IF EXISTS `lc60_successful_subtask_task_with_calculated_scoring`;

CREATE ALGORITHM=UNDEFINED DEFINER=`tggtt`@`localhost` SQL SECURITY DEFINER VIEW `lc60_successful_subtask_task_with_calculated_scoring` AS select `successful_subtask_task`.`participant_id` AS `participant_id`,`successful_subtask_task`.`dream_id` AS `dream_id`,`successful_subtask_task`.`dream_type_id` AS `dream_type_id`,`successful_subtask_task`.`dream_timestamp` AS `dream_timestamp`,`successful_subtask_task`.`dream_url` AS `dream_url`,`successful_subtask_task`.`contemporary_task_id` AS `contemporary_task_id`,`successful_subtask_task`.`contemporary_task_start` AS `contemporary_task_start`,`successful_subtask_task`.`contemporary_task_expiration` AS `contemporary_task_expiration`,`successful_subtask_task`.`subtask_id` AS `subtask_id`,`successful_subtask_task`.`subtask_task_id` AS `subtask_task_id`,`successful_subtask_task`.`subtask_super_id` AS `subtask_super_id`,`successful_subtask_task`.`subtask_name` AS `subtask_name`,`successful_subtask_task`.`subtask_category_id` AS `subtask_category_id`,`successful_subtask_task`.`subtask_base_value` AS `subtask_base_value`,`successful_subtask_task`.`subtask_max_value` AS `subtask_max_value`,`successful_subtask_task`.`subtask_starting_demand` AS `subtask_starting_demand`,`successful_subtask_task`.`subtask_inflation_rate` AS `subtask_inflation_rate`,`successful_subtask_task`.`subtask_demand_cutoff` AS `subtask_demand_cutoff`,`successful_subtask_task`.`subtask_bonus_base` AS `subtask_bonus_base`,`successful_subtask_task`.`subtask_task_period_demand` AS `subtask_task_period_demand`,`successful_subtask_task`.`subtask_description` AS `subtask_description`,`successful_subtask_task`.`subtask_url` AS `subtask_url`,`successful_subtask_task`.`subtask_accumulative` AS `subtask_accumulative`,`successful_subtask_task`.`subtask_owner_participant_id` AS `subtask_owner_participant_id`,`successful_subtask_task`.`subtask_category_name` AS `subtask_category_name`,`successful_subtask_task`.`subtask_category_class` AS `subtask_category_class`,`successful_subtask_task`.`subtask_category_description` AS `subtask_category_description`,`successful_subtask_task`.`subtask_type_id` AS `subtask_type_id`,`calculated_subtask_demand_final_value`.`subtask_success_count` AS `subtask_success_count`,`calculated_subtask_demand_final_value`.`subtask_success_count_total` AS `subtask_success_count_total`,`calculated_subtask_demand_final_value`.`contemporary_demand` AS `contemporary_demand`,`calculated_subtask_demand_final_value`.`contemporary_demand_positive` AS `contemporary_demand_positive`,`calculated_subtask_demand_final_value`.`inner_function` AS `inner_function`,`calculated_subtask_demand_final_value`.`external_function` AS `external_function`,`calculated_subtask_demand_final_value`.`final_value` AS `final_value`,truncate(`calculated_subtask_demand_final_value`.`final_value`,2) AS `final_value_truncate`,`successful_subtask_task`.`subtask_dividend_rate` AS `subtask_dividend_rate` from (`lc60_successful_subtask_task` `successful_subtask_task` join `lc60_calculated_subtask_demand_final_value` `calculated_subtask_demand_final_value` on(((`successful_subtask_task`.`subtask_id` = `calculated_subtask_demand_final_value`.`subtask_id`) and (`successful_subtask_task`.`contemporary_task_id` = `calculated_subtask_demand_final_value`.`contemporary_task_id`)))) where (`successful_subtask_task`.`contemporary_task_id` = `calculated_subtask_demand_final_value`.`current_task_id`);

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

