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.
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
'use strict';
|
||
|
||
/** Stufe pro politischem Amt (Tageshonorar: base + perRank × hierarchy_level). */
|
||
module.exports = {
|
||
async up(queryInterface) {
|
||
await queryInterface.sequelize.query(`
|
||
ALTER TABLE falukant_type.political_office_type
|
||
ADD COLUMN IF NOT EXISTS hierarchy_level INTEGER NOT NULL DEFAULT 1;
|
||
`);
|
||
|
||
await queryInterface.sequelize.query(`
|
||
UPDATE falukant_type.political_office_type AS pot
|
||
SET hierarchy_level = sub.lvl
|
||
FROM (VALUES
|
||
('assessor', 1),
|
||
('councillor', 1),
|
||
('council', 2),
|
||
('beadle', 2),
|
||
('town-clerk', 2),
|
||
('mayor', 3),
|
||
('master-builder', 2),
|
||
('village-major', 2),
|
||
('judge', 3),
|
||
('bailif', 3),
|
||
('taxman', 2),
|
||
('sheriff', 3),
|
||
('consultant', 3),
|
||
('treasurer', 4),
|
||
('hangman', 2),
|
||
('territorial-council', 3),
|
||
('territorial-council-speaker', 4),
|
||
('ruler-consultant', 4),
|
||
('state-administrator', 4),
|
||
('super-state-administrator', 5),
|
||
('governor', 5),
|
||
('ministry-helper', 4),
|
||
('minister', 5),
|
||
('chancellor', 6)
|
||
) AS sub(name, lvl)
|
||
WHERE pot.name = sub.name;
|
||
`);
|
||
},
|
||
|
||
async down(queryInterface) {
|
||
await queryInterface.sequelize.query(`
|
||
ALTER TABLE falukant_type.political_office_type
|
||
DROP COLUMN IF EXISTS hierarchy_level;
|
||
`);
|
||
}
|
||
};
|