Some checks failed
Deploy to production / deploy (push) Has been cancelled
- 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.
31 lines
901 B
JavaScript
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';
|
|
`);
|
|
},
|
|
};
|