-
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.
- Loading branch information
1 parent
605d6df
commit 7df4227
Showing
3 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
database/migrations/2024.12.27T00.00.00.box-with-image-size-variants.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,20 @@ | ||
"use strict"; | ||
|
||
/** | ||
* what this migration is doing: | ||
Switches existing "ImgMTextL" variant BoxWithImage instances to their new equivalents | ||
*/ | ||
|
||
async function up(knex) { | ||
try { | ||
const result = await knex("components_page_box_with_images").whereNotNull('variant').update({ | ||
variant: 'M' | ||
}); | ||
console.log(`Updated ${result.length} row(s)`); | ||
} catch (error) { | ||
console.log("error occured during migration. Skipping migration"); | ||
console.log(error); | ||
} | ||
} | ||
|
||
module.exports = { up }; |
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 |
---|---|---|
|
@@ -42,7 +42,12 @@ | |
"variant": { | ||
"type": "enumeration", | ||
"enum": [ | ||
"ImgMTextL" | ||
"XS", | ||
"S", | ||
"M", | ||
"L", | ||
"XL", | ||
"XXL" | ||
] | ||
} | ||
} | ||
|
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