-
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.
feat: add migration to mark old tags format (#60)
- Loading branch information
1 parent
c80f141
commit 1e174bc
Showing
4 changed files
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,9 @@ jobs: | |
node-version: 20.x | ||
- name: Build and Test | ||
run: | | ||
: # Temp corepack fix: https://github.com/nodejs/corepack/issues/612 | ||
corepack install -g [email protected] | ||
corepack enable | ||
pnpm install | ||
pnpm -r build | ||
|
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 |
---|---|---|
|
@@ -18,6 +18,9 @@ jobs: | |
node-version: 20.x | ||
- name: Install dependencies | ||
run: | | ||
: # Temp corepack fix: https://github.com/nodejs/corepack/issues/612 | ||
corepack install -g [email protected] | ||
corepack enable | ||
pnpm install | ||
- name: Install Playwright browsers | ||
|
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,4 +1,8 @@ | ||
FROM node:20-alpine AS builder | ||
|
||
# Temp corepack fix: https://github.com/nodejs/corepack/issues/612 | ||
RUN corepack install -g [email protected] | ||
|
||
RUN corepack enable | ||
WORKDIR /builder | ||
COPY package.json pnpm-*.yaml ./ | ||
|
17 changes: 17 additions & 0 deletions
17
src/extensions/migrations/20250131GP-mark-user-tags-as-old-format.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,17 @@ | ||
export async function up (knex) { | ||
const probesWithTags = await knex('gp_adopted_probes').select().whereNot({ tags: '[]' }); | ||
|
||
probesWithTags.forEach((probe) => { | ||
probe.tags = JSON.stringify(JSON.parse(probe.tags).map(tag => ({ ...tag, format: 'v1' }))); | ||
}); | ||
|
||
for (const probe of probesWithTags) { | ||
await knex('gp_adopted_probes').where({ id: probe.id }).update({ tags: probe.tags }); | ||
} | ||
|
||
console.log('Marked user tags as old format'); | ||
} | ||
|
||
export async function down () { | ||
console.log('There is no down operation for that migration.'); | ||
} |