RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/CLAUDE.md/triggerdotdev/trigger.dev

CLAUDE.md

internal-packages/database/CLAUDE.md
CLAUDE.md

Quality

65/100

Scores the file, not the repository.

Length

290 words

6 headings · 3 code blocks

Repository

16k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
triggerdotdev/trigger.dev/internal-packages/database/CLAUDE.mdRawGitHub
1# Database Package
2 
3Prisma 6.14.0 client and schema for PostgreSQL (`@trigger.dev/database`).
4 
5## Schema
6 
7Located at `prisma/schema.prisma`. Key models include TaskRun, BackgroundWorker, BackgroundWorkerTask, WorkerDeployment, RuntimeEnvironment, and Project.
8 
9### Engine Versions
10 
11```prisma
12enum RunEngineVersion {
13 V1 // Retired v3 engine - no longer executes; kept for historical rows and rejection
14 V2 // Current (run-engine + redis-worker)
15}
16```
17 
18New code should always target V2.
19 
20## Creating Migrations
21 
221. Edit `prisma/schema.prisma`
232. Generate migration:
24```bash
25 cd internal-packages/database
26 pnpm run db:migrate:dev:create --name "descriptive_name"
27```
283. **Clean up generated migration** - remove extraneous lines for:
29 - `_BackgroundWorkerToBackgroundWorkerFile`
30 - `_BackgroundWorkerToTaskQueue`
31 - `_TaskRunToTaskRunTag`
32 - `_WaitpointRunConnections`
33 - `_completedWaitpoints`
34 - `SecretStore_key_idx`
35 - Various `TaskRun` indexes (unless you added them)
364. Apply migration:
37```bash
38 pnpm run db:migrate:deploy && pnpm run generate
39```
40 
41## Index Migration Rules
42 
43When adding indexes to **existing tables**:
44 
45- Use `CREATE INDEX CONCURRENTLY IF NOT EXISTS` to avoid table locks in production
46- CONCURRENTLY indexes **must be in their own separate migration file** - they cannot be combined with other schema changes (PostgreSQL requirement)
47- Only add one index per migration file
48- Pre-apply the index manually in production before deploying the migration (Prisma will skip creation if the index already exists)
49 
50Indexes on **newly created tables** (in the same migration as `CREATE TABLE`) do not need CONCURRENTLY and can be in the same migration file.
51 
52When adding an index on a **new column on an existing table**, use two migrations:
531. First migration: `ALTER TABLE ... ADD COLUMN IF NOT EXISTS ...` (the column)
542. Second migration: `CREATE INDEX CONCURRENTLY IF NOT EXISTS ...` (the index, in its own file)
55 
56See `README.md` in this directory and `ai/references/migrations.md` for the full index workflow.
57 
58## Read Replicas
59 
60Use `$replica` from `~/db.server` for read-heavy queries in the webapp.
61 

Commands it names

  • pnpm run db:migrate:dev:create --name "descriptive_name"
  • pnpm run db:migrate:deploy && pnpm run generate

Sections

  • Database Package
  • Schema
  • Engine Versions
  • Creating Migrations
  • Index Migration Rules
  • Read Replicas

What it covers

typesdatabasedo-not

Stack — with the evidence

typescript

(1.00)

prisma

(1.00)

playwright

(1.00)

pnpm

(0.85)

react

(0.70)

remix

(0.70)

express

(0.70)

drizzle

(0.70)

postgres

(0.70)

redis

(0.70)

tailwind

(0.70)

vite

(0.70)

vitest

(0.70)

vercel

(0.70)

aws

(0.70)

javascript

(0.60)

node

(0.60)

turborepo

(0.60)

monorepo

(0.60)

github-actions

(0.60)

Format

CLAUDE.md

Claude Code's memory file. Shaped like AGENTS.md but with two things it lacks: @path imports, so shared rules live in one place, and a user-scope layer that follows the developer across repos rather than shipping with the code.

What the corpus says about it

Repository

Owner
triggerdotdev
Language
—
License
—
Archived
no

All configs in this repo

Also in triggerdotdev/trigger.dev

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
triggerdotdev/trigger.dev.cursor/rules/executing-commands.mdc · 16kCursor rulestypescriptprisma+18test49/1003 days ago
triggerdotdev/trigger.dev.cursor/rules/otel-metrics.mdc · 16kCursor rulestypescriptprisma+18styledo-not61/1003 days ago
triggerdotdev/trigger.dev.cursor/rules/webapp.mdc · 16kCursor rulestypescriptprisma+18setuptestsecurity55/1003 days ago
triggerdotdev/trigger.dev.cursor/rules/writing-tasks.mdc · 16kCursor rulestypescriptprisma+18setupbuildarchtypes+564/1003 days ago
triggerdotdev/trigger.dev.github/copilot-instructions.md · 16kCopilot instructionstypescriptprisma+18teststyletypes32/1003 days ago
triggerdotdev/trigger.devAGENTS.md · 16kAGENTS.mdtypescriptprisma+18setupbuildtestlint-format+888/1003 days ago
triggerdotdev/trigger.devapps/supervisor/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18no sections25/1003 days ago
triggerdotdev/trigger.devapps/webapp/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18setupbuildteststyle+588/1003 days ago
triggerdotdev/trigger.devinternal-packages/clickhouse/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+19styletypesdo-not61/1003 days ago
triggerdotdev/trigger.devinternal-packages/run-engine/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18buildteststyle70/1003 days ago
triggerdotdev/trigger.devpackages/core/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18no sections31/1003 days ago
triggerdotdev/trigger.devpackages/redis-worker/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18test29/1003 days ago
triggerdotdev/trigger.devpackages/trigger-sdk/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18do-not54/1003 days ago
triggerdotdev/trigger.devpackages/cli-v3/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18deploymentdo-notdocs51/1003 days ago
Diff against .cursor/rules/executing-commands.mdc Diff against .cursor/rules/otel-metrics.mdc Diff against .cursor/rules/webapp.mdc Diff against .cursor/rules/writing-tasks.mdc Diff against .github/copilot-instructions.md Diff against AGENTS.md Diff against apps/supervisor/CLAUDE.md Diff against apps/webapp/CLAUDE.md Diff against internal-packages/clickhouse/CLAUDE.md Diff against internal-packages/run-engine/CLAUDE.md Diff against packages/core/CLAUDE.md Diff against packages/redis-worker/CLAUDE.md Diff against packages/trigger-sdk/CLAUDE.md Diff against packages/cli-v3/CLAUDE.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
dotCMS/corecore-web/CLAUDE.md · 950CLAUDE.mdjavanode+13teststylearchtesting-strategy+3100/1003 days ago
Adit-Jain-srm/NightmareNetCLAUDE.md · 45CLAUDE.mdtypescriptpython+18buildtestlint-formatstyle+6100/1003 days ago
microsoft/playwrightCLAUDE.md · 94kCLAUDE.mdtypescriptjavascript+10buildtestlint-formatstyle+7100/1003 days ago
nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4kCLAUDE.mdtypescriptnode+16setupbuildstylearch+2100/1003 days ago
bagisto/bagistoCLAUDE.md · 28kCLAUDE.mdphplaravel+8setupbuildteststyle+5100/1003 days ago
dotCMS/coreCLAUDE.md · 950CLAUDE.mdjavanode+9setupbuildteststyle+799/1003 days ago
lollipopkit/flutter_server_boxCLAUDE.md · 8.3kCLAUDE.mddartflutter+8buildteststylearch+298/1003 days ago
oven-sh/buntest/CLAUDE.md · 95kCLAUDE.mdtypescriptjavascript+14teststyletesting-strategydo-not97/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack