-
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.
Merge branch 'j-s/civil-claimant-data-structure' of https://github.co…
…m/island-is/island.is into j-s/civil-claimant-data-structure
- Loading branch information
Showing
21 changed files
with
243 additions
and
87 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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export { Defendant } from './models/defendant.model' | ||
export { DeleteDefendantResponse } from './models/delete.response' | ||
export { CivilClaimant } from './models/civilClaimant.model' | ||
export { DeleteCivilClaimantResponse } from './models/deleteCivilClaimant.response' |
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
1 change: 1 addition & 0 deletions
1
apps/judicial-system/backend/src/app/modules/defendant/index.ts
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { Defendant } from './models/defendant.model' | ||
export { DefendantService } from './defendant.service' | ||
export { CivilClaimant } from './models/civilClaimant.model' |
30 changes: 30 additions & 0 deletions
30
apps/services/endorsements/api/migrations/20240904000001-endorsement-count.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,30 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
// Add the 'endorsement_count' column to 'endorsement_list' table | ||
await queryInterface.addColumn('endorsement_list', 'endorsement_count', { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
defaultValue: 0, | ||
}) | ||
|
||
// Add composite index on 'endorsement_count' and 'counter' | ||
await queryInterface.addIndex( | ||
'endorsement_list', | ||
['endorsement_count', 'counter'], | ||
{ | ||
name: 'idx_endorsement_count_counter', | ||
}, | ||
) | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
// Remove the composite index on 'endorsement_count' and 'counter' | ||
await queryInterface.removeIndex( | ||
'endorsement_list', | ||
'idx_endorsement_count_counter', | ||
) | ||
|
||
// Remove the 'endorsement_count' column from 'endorsement_list' table | ||
await queryInterface.removeColumn('endorsement_list', 'endorsement_count') | ||
}, | ||
} |
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
45 changes: 45 additions & 0 deletions
45
libs/auth-api-lib/migrations/20240915135625-delegation-allow-null-domain_name.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,45 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
async up(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
-- 1. Drop the existing unique constraint on (domain_name, from_national_id, to_national_id) | ||
ALTER TABLE delegation | ||
DROP CONSTRAINT IF EXISTS unique_domain_from_to; | ||
-- 2. Alter the domain_name column to allow NULL and remove the default value | ||
ALTER TABLE delegation | ||
ALTER COLUMN domain_name DROP DEFAULT, | ||
ALTER COLUMN domain_name DROP NOT NULL; | ||
-- 3. Create a new unique index to enforce uniqueness where NULL is treated as a value | ||
CREATE UNIQUE INDEX unique_domain_from_to_index | ||
ON delegation (COALESCE(domain_name, 'NULL'), from_national_id, to_national_id); | ||
COMMIT; | ||
`) | ||
}, | ||
|
||
async down(queryInterface) { | ||
return queryInterface.sequelize.query(` | ||
BEGIN; | ||
-- 1. Drop the unique index created with COALESCE | ||
DROP INDEX IF EXISTS unique_domain_from_to_index; | ||
-- 2. Alter the domain_name column to make it NOT NULL again and add the default value | ||
ALTER TABLE delegation | ||
ALTER COLUMN domain_name SET DEFAULT '@island.is', | ||
ALTER COLUMN domain_name SET NOT NULL; | ||
-- 3. Recreate the original unique constraint on (domain_name, from_national_id, to_national_id) | ||
ALTER TABLE delegation ADD CONSTRAINT unique_domain_from_to | ||
UNIQUE (domain_name, from_national_id, to_national_id); | ||
COMMIT; | ||
`) | ||
}, | ||
} |
Oops, something went wrong.