Skip to content

Commit

Permalink
feat: add migration to mark old tags format (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh authored Feb 26, 2025
1 parent c80f141 commit 1e174bc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
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 ./
Expand Down
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.');
}

0 comments on commit 1e174bc

Please sign in to comment.