-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/application-system-config
- Loading branch information
Showing
171 changed files
with
7,844 additions
and
2,812 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
apps/judicial-system/backend/migrations/20240904100012-update-institution.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,48 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.addColumn('institution', 'address', { | ||
type: Sequelize.STRING, | ||
allowNull: true, | ||
}) | ||
|
||
const institutionsToUpdate = [ | ||
{ | ||
name: 'Héraðsdómur Reykjavíkur', | ||
address: 'Dómhúsið við Lækjartorg, Reykjavík', | ||
}, | ||
{ name: 'Héraðsdómur Reykjaness', address: 'Fjarðargata 9, Hafnarfirði' }, | ||
{ | ||
name: 'Héraðsdómur Vesturlands', | ||
address: 'Bjarnarbraut 8, Borgarnesi', | ||
}, | ||
{ name: 'Héraðsdómur Vestfjarða', address: 'Hafnarstræti 9, Ísafirði' }, | ||
{ | ||
name: 'Héraðsdómur Norðurlands vestra', | ||
address: 'Skagfirðingabraut 21, Sauðárkróki', | ||
}, | ||
{ | ||
name: 'Héraðsdómur Norðurlands eystra', | ||
address: 'Hafnarstræti 107, 4. hæð, Akureyri', | ||
}, | ||
{ name: 'Héraðsdómur Austurlands', address: 'Lyngás 15, Egilsstöðum' }, | ||
{ name: 'Héraðsdómur Suðurlands', address: 'Austurvegur 4, Selfossi' }, | ||
] | ||
|
||
await queryInterface.sequelize.transaction(async (transaction) => { | ||
for (const institution of institutionsToUpdate) { | ||
await queryInterface.bulkUpdate( | ||
'institution', | ||
{ address: institution.address }, | ||
{ name: institution.name }, | ||
{ transaction }, | ||
) | ||
} | ||
}) | ||
}, | ||
|
||
down: async (queryInterface) => { | ||
await queryInterface.removeColumn('institution', 'address') | ||
}, | ||
} |
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
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
Oops, something went wrong.