Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migration script typo #3775

Merged
merged 1 commit into from
Jul 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions server/models/migrations/next/migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ delimiter $$

-- this Procedure help to make quick analyse about unbalanced invoice
-- it create a table name 'unbalancedInvoices' that can be used by the analyser
DROP PROCEDURE IF EXISTS UnbalancedInvoicePaymentsTable$$
DROP PROCEDURE IF EXISTS UnbalancedInvoicePayments$$
CREATE PROCEDURE UnbalancedInvoicePayments(
IN dateFrom DATE,
IN dateTo DATE
Expand Down Expand Up @@ -228,7 +228,7 @@ DECLARE _id mediumint(8) unsigned;
DECLARE _start_date, _end_date DATE;

DECLARE done BOOLEAN;
DECLARE curs1 CURSOR FOR
DECLARE curs1 CURSOR FOR
SELECT id, start_date, end_date FROM period;

DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
Expand All @@ -239,14 +239,14 @@ OPEN curs1;
IF done THEN
LEAVE read_loop;
END IF;
UPDATE period SET
period.translate_key = CONCAT('TABLE.COLUMNS.DATE_MONTH.', UPPER(DATE_FORMAT(_start_date, "%M"))),
period.year = YEAR(_start_date)
WHERE period.id = _id;
UPDATE period SET
period.translate_key = CONCAT('TABLE.COLUMNS.DATE_MONTH.', UPPER(DATE_FORMAT(_start_date, "%M"))),
period.year = YEAR(_start_date)
WHERE period.id = _id;
END LOOP;
CLOSE curs1;
END$$
DELIMITER ;

-- update columns
call UpdatePeriodLabels();
-- update columns
call UpdatePeriodLabels();