-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #458 from Open-Earth-Foundation/fix/region-country…
…-locode feat(api): add countryLocode and regionLocode to city
- Loading branch information
Showing
5 changed files
with
75 additions
and
16 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
app/migrations/20240424131954-add-country-region-locode.cjs
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,35 @@ | ||
"use strict"; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
await queryInterface.sequelize.transaction(async (transaction) => { | ||
await queryInterface.addColumn( | ||
"City", | ||
"country_locode", | ||
Sequelize.STRING, | ||
{ transaction }, | ||
); | ||
|
||
await queryInterface.addColumn( | ||
"City", | ||
"region_locode", | ||
Sequelize.STRING, | ||
{ | ||
transaction, | ||
}, | ||
); | ||
}); | ||
}, | ||
|
||
async down(queryInterface) { | ||
await queryInterface.sequelize.transaction(async (transaction) => { | ||
await queryInterface.removeColumn("City", "country_locode", { | ||
transaction, | ||
}); | ||
await queryInterface.removeColumn("City", "region_locode", { | ||
transaction, | ||
}); | ||
}); | ||
}, | ||
}; |
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