Migration to MySQL 5.7 - ensure all group by clauses are valid

This commit is contained in:
conradsp
2018-03-07 13:04:42 -06:00
parent d2b341159c
commit 9688f38ed3
15 changed files with 42 additions and 19 deletions
@@ -49,7 +49,7 @@ begin
declare cursor1 cursor for
select sa.currency_code, sa.withdrawal_fee_type_enum, sa.withdrawal_fee_amount
from m_savings_account sa where sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0 group by sa.currency_code, sa.withdrawal_fee_type_enum;
from m_savings_account sa where sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0 group by sa.currency_code, sa.withdrawal_fee_type_enum, sa.withdrawal_fee_amount;
declare cursor2 cursor for
select sa.id, sa.withdrawal_fee_amount from m_savings_account sa where sa.currency_code=v_currency_code and sa.withdrawal_fee_type_enum=v_withdrawal_fee_type_enum and sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0;
@@ -164,7 +164,7 @@ begin
declare cursor1 cursor for
select sa.currency_code, sa.annual_fee_amount
from m_savings_account sa where sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null group by sa.currency_code;
from m_savings_account sa where sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null group by sa.currency_code, sa.annual_fee_amount;
declare cursor2 cursor for
select sa.id, sa.annual_fee_amount, sa.annual_fee_on_month, sa.annual_fee_on_day, sa.annual_fee_next_due_date from m_savings_account sa where sa.currency_code=v_currency_code and sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null;
@@ -19,10 +19,10 @@
INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`) VALUES (NULL, 'force-password-reset-days', '0', '0');
ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NOT NULL ,
ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NOT NULL DEFAULT '1970-01-01',
ADD INDEX ( `last_time_password_updated` ) ;
UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` ='0000-00-00';
UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` ='1970-01-01';
CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -123,6 +123,7 @@ mlrr.loan_id,
where mlt.reshedule_request_id is not null
and (mlt.term_type =8 or mlt.term_type = 7)
and mlt.reshedule_request_id = mlrr.id
group by mlt.id
order by mlt.term_type desc limit 1) parent_id
from m_loan_reschedule_request mlrr
where (mlrr.grace_on_interest is not null or mlrr.grace_on_principal is not null));
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+--
+
+ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;