-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(j-s): Add new case decision for closing without ruling
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
apps/judicial-system/backend/migrations/20250121143923-update-case.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict' | ||
|
||
const replaceEnum = require('sequelize-replace-enum-postgres').default | ||
|
||
module.exports = { | ||
up: async (queryInterface) => { | ||
// Safely add the new enum value to the type without replacing the entire enum | ||
await queryInterface.sequelize.query(` | ||
ALTER TYPE enum_case_decision | ||
ADD VALUE IF NOT EXISTS 'COMPLETED_WITHOUT_RULING'; | ||
`) | ||
}, | ||
|
||
down: (queryInterface) => { | ||
return replaceEnum({ | ||
queryInterface, | ||
tableName: 'case', | ||
columnName: 'decision', | ||
newValues: [ | ||
'ACCEPTING', | ||
'REJECTING', | ||
'ACCEPTING_ALTERNATIVE_TRAVEL_BAN', | ||
'ACCEPTING_PARTIALLY', | ||
'DISMISSING', | ||
], | ||
enumName: 'enum_case_decision', | ||
}) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters