-
Notifications
You must be signed in to change notification settings - Fork 0
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 #98 from atlp-rwanda/187967401-fix-get-products-by…
…-seller fix-get-products-by-seller
- Loading branch information
Showing
4 changed files
with
68 additions
and
9 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
28 changes: 28 additions & 0 deletions
28
src/database/migrations/20240717004630-update-product-attribute.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,28 @@ | ||
'use strict'; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
// Rename the column | ||
await queryInterface.renameColumn( | ||
'products', | ||
'categoryId', | ||
'categoryName', | ||
{ | ||
type: Sequelize.STRING, | ||
} | ||
); | ||
}, | ||
|
||
async down(queryInterface, Sequelize) { | ||
// Revert the change in case of rollback | ||
await queryInterface.renameColumn( | ||
'products', | ||
'categoryName', | ||
'categoryId', | ||
{ | ||
type: Sequelize.STRING, | ||
} | ||
); | ||
}, | ||
}; |
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