-
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.
Add column to delegation type indicating if actor discretion is requi…
…red.
- Loading branch information
1 parent
9ef986b
commit c039332
Showing
11 changed files
with
166 additions
and
22 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
libs/auth-api-lib/migrations/20240927103047-add-discretion-column-to-delegation-type.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,22 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
return Promise.all([ | ||
queryInterface.addColumn('delegation_type', 'actor_discretion_required', { | ||
type: Sequelize.BOOLEAN, | ||
allowNull: false, | ||
defaultValue: false, | ||
}), | ||
]) | ||
}, | ||
|
||
async down(queryInterface) { | ||
return Promise.all([ | ||
queryInterface.removeColumn( | ||
'delegation_type', | ||
'actor_discretion_required', | ||
), | ||
]) | ||
}, | ||
} |
39 changes: 39 additions & 0 deletions
39
libs/auth-api-lib/migrations/20240927153835-add_fk_constraints_to_delegation_index.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,39 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up: (queryInterface) => { | ||
return Promise.all([ | ||
queryInterface.addConstraint('delegation_index', { | ||
fields: ['type'], | ||
type: 'foreign key', | ||
name: 'FK_delegation_index_delegation_type', | ||
references: { | ||
table: 'delegation_type', | ||
field: 'id', | ||
}, | ||
}), | ||
queryInterface.addConstraint('delegation_index', { | ||
fields: ['provider'], | ||
type: 'foreign key', | ||
name: 'FK_delegation_index_delegation_provider', | ||
references: { | ||
table: 'delegation_provider', | ||
field: 'id', | ||
}, | ||
}), | ||
]) | ||
}, | ||
|
||
down: (queryInterface) => { | ||
return Promise.all([ | ||
queryInterface.removeConstraint( | ||
'delegation_index', | ||
'FK_delegation_index_delegation_type', | ||
), | ||
queryInterface.removeConstraint( | ||
'delegation_index', | ||
'FK_delegation_index_delegation_provider', | ||
), | ||
]) | ||
}, | ||
} |
23 changes: 23 additions & 0 deletions
23
libs/auth-api-lib/seeders/20241001144241-set-actor-discretion-for-legal-repr.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,23 @@ | ||
module.exports = { | ||
up(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
UPDATE delegation_type | ||
SET actor_discretion_required = true | ||
WHERE id = 'LegalRepresentative'; | ||
COMMIT; | ||
`) | ||
}, | ||
|
||
down(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
UPDATE delegation_type | ||
SET actor_discretion_required = false | ||
WHERE id = 'LegalRepresentative'; | ||
COMMIT; | ||
`) | ||
}, | ||
} |
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
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