|
|
@@ -307,7 +307,7 @@ jQuery(document).ready(function () {
|
|
|
}
|
|
|
|
|
|
public function installView() {
|
|
|
- $sql = "
|
|
|
+ $sql['test_budget_project_analytics_view_1'] = "
|
|
|
CREATE VIEW `test_budget_project_analytics_view` AS
|
|
|
select `IN7_DZIENNIK_KORESP`.`ID_PROJECT` AS `ID_PROJECT`
|
|
|
, date_format(`IN7_DZIENNIK_KORESP`.`K_DATA_OTRZYMANEJ_KORESP`,'%Y-%m') AS `MONTH`
|
|
|
@@ -330,7 +330,7 @@ jQuery(document).ready(function () {
|
|
|
)
|
|
|
group by `p`.`ID`, date_format(k.`K_DATA_OTRZYMANEJ_KORESP`, '%Y-%m')
|
|
|
";
|
|
|
- $sql = "
|
|
|
+ $sql['test_budget_project_analytics_view_2'] = "
|
|
|
CREATE VIEW `test_budget_project_synthetics_view` AS
|
|
|
select `t1`.`ID_PROJECT` AS `ID_PROJECT`
|
|
|
, `p`.`M_DIST_DESC` AS `M_DIST_DESC`
|
|
|
@@ -462,8 +462,8 @@ jQuery(document).ready(function () {
|
|
|
* Read from TABLE `IN7_DZIENNIK_KORESP`
|
|
|
*/
|
|
|
function test_reinstallViewsAndEvents() {
|
|
|
- $sqlList['RemoveView_korespMain'] = " drop view if exists `in7_dziennik_koresp_budget_main_view` ";
|
|
|
- $sqlList['CreateView_korespMain'] = "
|
|
|
+ $sqlList['RemoveView_korespMain1'] = " drop view if exists `in7_dziennik_koresp_budget_main_view` ";
|
|
|
+ $sqlList['CreateView_korespMain2'] = "
|
|
|
CREATE VIEW `in7_dziennik_koresp_budget_main_view` AS
|
|
|
select cast(substring_index(substring_index(k.`path`,'-',2),'-',-(1)) as signed) AS `ID`
|
|
|
, substring_index(k.`path`,'-',2) AS `path`
|
|
|
@@ -516,8 +516,8 @@ jQuery(document).ready(function () {
|
|
|
where (k.`COST_VALUE` <> '')
|
|
|
group by substring_index(k.`path`,'-',2)
|
|
|
";
|
|
|
- $sqlList['RemoveView_korespMain'] = " drop view if exists `in7_dziennik_koresp_budget_view` ";
|
|
|
- $sqlList['CreateView_korespMain'] = "
|
|
|
+ $sqlList['RemoveView_korespMain3'] = " drop view if exists `in7_dziennik_koresp_budget_view` ";
|
|
|
+ $sqlList['CreateView_korespMain4'] = "
|
|
|
CREATE or replace VIEW `in7_dziennik_koresp_budget_view` AS
|
|
|
select k.`ID` AS `ID`
|
|
|
, k.`path` AS `path`
|
|
|
@@ -572,8 +572,8 @@ jQuery(document).ready(function () {
|
|
|
where (k.`COST_VALUE`!='')
|
|
|
group by k.`ID_PROJECT`
|
|
|
";
|
|
|
- $sqlList['RemoveEvent_everyDay'] = "DROP EVENT IF EXISTS `view__budget_project_to_realization_main_event`";
|
|
|
- $sqlList['CreateEvent_everyDay'] = "
|
|
|
+ $sqlList['RemoveEvent_everyDay5'] = "DROP EVENT IF EXISTS `view__budget_project_to_realization_main_event`";
|
|
|
+ $sqlList['CreateEvent_everyDay6'] = "
|
|
|
CREATE EVENT `view__budget_project_to_realization_main_event`
|
|
|
ON SCHEDULE EVERY 1 DAY STARTS '2015-05-12 00:04:30'
|
|
|
ON COMPLETION NOT PRESERVE ENABLE
|