Files
yourpart3/backend/migrations-archive/20260402120000-add-ui-locale-fr-user-param-value.cjs
Torsten Schulz (local) 5070785a50
Some checks failed
Deploy to production / deploy (push) Has been cancelled
feat(deploy): update deployment workflow and migration paths
- Modified the deployment workflow to include new migration paths for the backend, ensuring that migrations are correctly referenced in the deployment process.
- Updated the `db:migrate` script in package.json to point to the `migrations-active` directory, enhancing clarity and organization of migration files.
- Adjusted the deployment conditions to account for changes in migration file locations, improving the accuracy of change detection during deployments.
- Removed obsolete migration files to streamline the migration process and prevent confusion.
2026-04-17 13:39:38 +02:00

31 lines
901 B
JavaScript

'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface) {
await queryInterface.sequelize.query(`
INSERT INTO type.user_param_value (user_param_type_id, value, order_id)
SELECT upt.id, 'fr', COALESCE(
(SELECT MAX(v.order_id) FROM type.user_param_value v WHERE v.user_param_type_id = upt.id),
0
) + 1
FROM type.user_param upt
WHERE upt.description = 'language'
AND NOT EXISTS (
SELECT 1 FROM type.user_param_value x
WHERE x.user_param_type_id = upt.id AND x.value = 'fr'
);
`);
},
async down(queryInterface) {
await queryInterface.sequelize.query(`
DELETE FROM type.user_param_value v
USING type.user_param upt
WHERE v.user_param_type_id = upt.id
AND upt.description = 'language'
AND v.value = 'fr';
`);
},
};