Skip to content

Consolidate migration scripts into pnpm-monorepo#1898

Merged
simonknittel merged 6 commits intodevelopfrom
copilot/migrate-migration-scripts
Feb 1, 2026
Merged

Consolidate migration scripts into pnpm-monorepo#1898
simonknittel merged 6 commits intodevelopfrom
copilot/migrate-migration-scripts

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Migration scripts were scattered in app/scripts/migrations, outside the monorepo structure. This consolidates them into a dedicated pnpm-monorepo/apps/migrations app.

Changes

  • New app structure: Created pnpm-monorepo/apps/migrations with proper package configuration
  • Import updates: Changed all imports from local ../prisma to @sam-monorepo/database workspace package
  • Modernized tooling:
    • Converted CommonJS JS files to ESM TypeScript
    • Replaced ts-node with tsx for better ESM support
    • Updated usage comments consistently across all scripts
  • Cleanup: Removed old app/scripts/migrations directory and unused prisma.ts helper

Migration structure

// Before: app/scripts/migrations/007-migrate-permissions.ts
import { prisma } from "../prisma";

// After: pnpm-monorepo/apps/migrations/scripts/migrations/007-migrate-permissions.ts
import { prisma } from "@sam-monorepo/database";

All 11 migration scripts (001a through 011) now live alongside other monorepo apps (lambda, playwright) with consistent tooling and imports.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/sam/sam/pnpm-monorepo/node_modules/.pnpm/prisma@6.17.1_typescript@5.9.3/node_modules/prisma/build/child {"product":"prisma","version":"6.17.1","cli_install_type":"local","information":"","local_timestamp":"2026-02-01T13:16:11Z","project_hash":"525e1e0a","cli_path":"/home/REDACTED/work/sam/sam/pnpm-monorepo/packages/database/node_modules/prisma/build/index.js" (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/sam/sam/pnpm-monorepo/node_modules/.pnpm/prisma@6.17.1_typescript@5.9.3/node_modules/prisma/build/child {"product":"prisma","version":"6.17.1","cli_install_type":"local","information":"","local_timestamp":"2026-02-01T13:16:31Z","project_hash":"525e1e0a","cli_path":"/home/REDACTED/work/sam/sam/pnpm-monorepo/packages/database/node_modules/prisma/build/index.js" (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/sam/sam/pnpm-monorepo/node_modules/.pnpm/prisma@6.17.1_typescript@5.9.3/node_modules/prisma/build/child {"product":"prisma","version":"6.17.1","cli_install_type":"local","information":"","local_timestamp":"2026-02-01T13:17:37Z","project_hash":"525e1e0a","cli_path":"/home/REDACTED/work/sam/sam/pnpm-monorepo/packages/database/node_modules/prisma/build/index.js" (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Migrate the migrations scripts from the app/scripts directory into an app in the pnpm-monorepo.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sam Ignored Ignored Preview Feb 1, 2026 1:49pm

- Create new migrations app in pnpm-monorepo/apps/migrations
- Migrate all scripts from app/scripts/migrations
- Update imports to use @sam-monorepo/database
- Convert JavaScript files to TypeScript
- Use tsx for running migrations (better ESM support)
- Add README with usage instructions
- Configure package.json with necessary dependencies

Co-authored-by: simonknittel <8451099+simonknittel@users.noreply.github.com>
@socket-security
Copy link

socket-security bot commented Feb 1, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addeddate-fns@​4.1.0981009280100
Addedcsv@​6.4.1991009981100
Addedtsx@​4.21.01001008185100
Addedalgoliasearch@​4.25.3991009699100

View full report

Copilot AI and others added 3 commits February 1, 2026 13:18
Co-authored-by: simonknittel <8451099+simonknittel@users.noreply.github.com>
- Remove unnecessary @ts-check directives from TypeScript files
- Remove unnecessary @ts-expect-error directives
- Update all usage comments to use 'npx tsx' consistently
- Fix typo in README (permssion -> permission)

Co-authored-by: simonknittel <8451099+simonknittel@users.noreply.github.com>
- Update 005-populate-citizen-caches.ts usage comment
- Update 006-populate-citizen-roles-cache.ts usage comment
- Remove remaining @ts-check directive from 002 script

Co-authored-by: simonknittel <8451099+simonknittel@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate migration scripts to pnpm-monorepo Consolidate migration scripts into pnpm-monorepo Feb 1, 2026
Copilot AI requested a review from simonknittel February 1, 2026 13:24
@simonknittel simonknittel marked this pull request as ready for review February 1, 2026 13:49
Copilot AI review requested due to automatic review settings February 1, 2026 13:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates scattered database migration scripts from app/scripts/migrations into a new dedicated monorepo app at pnpm-monorepo/apps/scripts. The changes modernize the tooling by converting CommonJS JavaScript files to ESM TypeScript and standardizing imports to use the @sam-monorepo/database workspace package.

Changes:

  • Created new pnpm-monorepo/apps/scripts app with proper package configuration and TypeScript setup
  • Migrated 11 migration scripts (001a through 011) and Algolia indexing script to use workspace package imports
  • Removed legacy app/scripts directory and helper files

Reviewed changes

Copilot reviewed 25 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-monorepo/package.json Added build:scripts command to build dependencies for migration scripts
pnpm-monorepo/apps/scripts/package.json New package configuration with dependencies and ESM setup
pnpm-monorepo/apps/scripts/tsconfig.json TypeScript configuration for the scripts app
pnpm-monorepo/apps/scripts/README.md Documentation for running migration scripts
pnpm-monorepo/apps/scripts/src/migrations/*.ts Migrated scripts with updated imports from workspace package
pnpm-monorepo/apps/scripts/src/algolia/*.ts Algolia indexing script with updated imports
pnpm-monorepo/apps/playwright/tsconfig.json Formatting fix for lib array
pnpm-monorepo/apps/playwright/playwright.config.ts Formatting fix for extraHTTPHeaders
pnpm-monorepo/apps/lambda/src/common/parameters.ts Formatting fix for map entries
pnpm-monorepo/.vscode/settings.json Added "algoliasearch" to spell check dictionary
.vscode/extensions.json Added Prisma VS Code extension recommendation
app/scripts/prisma.ts Removed old helper file
app/scripts/migrations/*.js Removed old migration scripts
Files not reviewed (1)
  • pnpm-monorepo/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonknittel simonknittel enabled auto-merge (squash) February 1, 2026 13:49
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 1, 2026

Quality Gate Passed Quality Gate passed

Issues
29 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@simonknittel simonknittel merged commit 4832ee5 into develop Feb 1, 2026
10 checks passed
@simonknittel simonknittel deleted the copilot/migrate-migration-scripts branch February 1, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants