1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-05 13:35:27 +02:00

fix: Canonicalize locale codes

This commit is contained in:
Maksim Eltyshev 2025-06-03 12:46:06 +02:00
parent fc7863aaaf
commit 46f4d5c1f8
10 changed files with 35 additions and 9 deletions

View file

@ -18,7 +18,7 @@ exports.up = async (knex) => {
FROM comment
GROUP BY card_id
) AS comments_total_by_card_id
WHERE card.id = comments_total_by_card_id.card_id
WHERE card.id = comments_total_by_card_id.card_id;
`);
return knex.schema.alterTable('card', (table) => {

View file

@ -0,0 +1,26 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
exports.up = (knex) =>
knex.raw(`
UPDATE user_account
SET language =
CASE
WHEN language = 'sr-Cyrl-CS' THEN 'sr-Cyrl-RS'
WHEN language = 'sr-Latn-CS' THEN 'sr-Latn-RS'
END
WHERE language IN ('sr-Cyrl-CS', 'sr-Latn-CS');
`);
exports.down = (knex) =>
knex.raw(`
UPDATE user_account
SET language =
CASE
WHEN language = 'sr-Cyrl-RS' THEN 'sr-Cyrl-CS'
WHEN language = 'sr-Latn-RS' THEN 'sr-Latn-CS'
END
WHERE language IN ('sr-Cyrl-RS', 'sr-Latn-RS');
`);