db-migration
Skill5 starsChanged 38 days agoMITView on GitHub
Creates TypeORM database migrations for the Qadam Flow server. Use when the user asks to add a column, create a table, add an index, or make any schema change to the database.
26 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- mohitkale/wordpress-devkittheir own version, first seen Nov 15, 2026
- chrysogonus/prompt-maker-studiotheir own version, first seen Nov 15, 2026
- ricci-labs/twisetheir own version, first seen Nov 8, 2026
- aniketshukla1/sdlc-kittheir own version, first seen Nov 8, 2026
- globalmpc/backendskillstheir own version, first seen Nov 8, 2026
- F3-Nation/f3-nationtheir own version, first seen Nov 2, 2026
Used with
Projects with it also use api-endpoint, write-tests and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tadoEngSkillapi-endpoint
Add or change a backend API endpoint on this product, keeping Pydantic as the single contract authority and regenerating the TypeScript client. Use when asked to add an endpoint, expose data to the frontend, change a request or response shape, or wire a new backend capability into a page.
Also in 4 projects that use this
SentrySkillwrite-tests
Write tests following project conventions. Use when adding new tests or modifying existing ones.
Also in 3 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 3 projects that use this
Microsoft AzureSkillverify
End-to-end app testing pipeline for browser-based web apps on cloud browsers via Azure Playwright Workspaces: verify the live app, author tests for working flows, heal failing tests, then re-run with video and produce one consolidated report. Three phases (app verification, test authoring, test healing) plus a scoped final sanity run; each phase emits a sub-report. Use when asked to "verify my app", "make sure my app works and has good test coverage", "do a full QA pass", "add tests where I'm missing coverage", "fix failing tests and add new ones", "smoke test before deploy", "QA my deployment", or any combined verify-and-test ask. Requires Azure CLI (`az login`) and a Playwright Workspace resource ID — bootstraps configs on first invocation. Browser-based web apps with Playwright only — not for unit/API tests, native mobile/desktop, load/perf, or full accessibility audits.
Also in 4 projects that use this
AnthropicSkilldebug
Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.
Also in 3 projects that use this
MicrosoftSkillrelease
Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).
Also in 3 projects that use this
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- jpoindexter/theft-kit★ 174% same
Wrote their own version · 25
- dipu-bd/lightnovel-crawler★ 2.6ksame name
- lncrawl/lightnovel-crawler★ 2.6ksame name
- openmeterio/openmeter★ 2.4ksame name
- F3-Nation/f3-nation★ 210same name
- hiromaily/go-crypto-wallet★ 128same name
- nrjdalal/zerostarter★ 65same name
- globalmpc/backendskills★ 59same name
- xin-lai/CodeSpirit★ 56same name
- NicholasFlemmer/styx-app★ 31same name
- nikandr-surkov/ai-saas-starter★ 16same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- .agents/features/agents.mdAGENTS.md
- AGENTS.mdAGENTS.md
- add-endpointSkill
- add-entitySkill
- add-featureSkill
- agent-browserSkill
- designSkill
- grill-meSkill
- local-docker-deploySkill
- mcp-builderSkill
- mintlifySkill
- playwright-e2e-testingSkill
- qadam-builderSkill
- ubiquitous-languageSkill
- versioningSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Create TypeORM database migrations for schema changes in the Qadam Flow server API.
- Very specific: line 24
Update the TypeORM entity file in packages/server/api/src/app/ to reflect the new schema.
- Very specific: line 50
Add breaking = false (or true if destructive)
- Very specific: line 51
Add release = '<version>' — the upcoming release, node tools/ci/compute-main-version.mjs --next
- Very specific: line 52
Verify down() correctly reverses up()
- Distinctive: line 109
After the migration is generated and registered, update any TypeScript types, service files, or other code that references the changed …
- Distinctive: line 113
Always try to create non-breaking migrations if possible to allow safe rollbacks
“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Qadam Flow DB Migration
Create TypeORM database migrations for schema changes in the Qadam Flow server API.
Workflow
Step 1: DETERMINE THE CHANGE
Before generating, identify:
- Which table(s) are affected
- What SQL is needed (
ADD COLUMN,CREATE TABLE,CREATE INDEX, etc.) - Whether the migration is breaking (drops columns/tables, transforms data irreversibly — cannot be rolled back safely)
- The release the migration will ship in:
node tools/ci/compute-main-version.mjs --next. Not the rootpackage.json— under ADR-0001 that holds the last release, which the migration is not part of (#798)
Step 2: UPDATE THE ENTITY
Update the TypeORM entity file in packages/server/api/src/app/ to reflect the new schema. This ensures the CLI generation command can diff against the current state.
Array columns always use this pattern:
columnName: {
type: String,
array: true,
nullable: false,
}Step 3: GENERATE THE MIGRATION USING THE CLI
Run from packages/server/api/:
npm run db-migration -- src/app/database/migration/postgres/MigrationNameThis diffs the current entity state against the database and generates the migration file with correct SQL and timestamp.
Step 4: PATCH THE GENERATED FILE
The CLI generates a file using MigrationInterface. You must patch it to use the project's Migration interface and add required fields:
- Replace
import { MigrationInterface, QueryRunner } from "typeorm"withimport { QueryRunner } from 'typeorm'and addimport { Migration } from '../../migration' - Replace
implements MigrationInterfacewithimplements Migration - Add
breaking = false(ortrueif destructive) - Add
release = '<version>'— the upcoming release,node tools/ci/compute-main-version.mjs --next - Verify
down()correctly reversesup()
Example result:
import { QueryRunner } from 'typeorm'
import { Migration } from '../../migration'
export class AddMyColumn1234567890 implements Migration {
name = 'AddMyColumn1234567890'
breaking = false
release = '0.78.0'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "project" ADD COLUMN "description" text`)
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "project" DROP COLUMN "description"`)
}
}Required fields:
name = '<ExportedClassName>'— the CLI sets this; do not blank it outbreaking = false— set totrueonly if rolling back is destructiverelease = '<version>'— the upcoming release (node tools/ci/compute-main-version.mjs --next; never the rootpackage.json's last release, or rolling back to that release would keep the migration)down()— must reverseup()(required)
The Migration type marks breaking/release optional, but _verify.yml's
"Check new migration metadata" step (part of the required Lint + Unit Tests
check, not a separate context of its own) runs
tools/scripts/check-migration-rollback.ts (npm run check-migration-metadata)
on every PR (#445): a new migration missing name, breaking, an
invalid/missing release, or missing down() fails the build and names the
field. down() missing is actually caught earlier still, at compile time —
typeorm's MigrationInterface.down is non-optional. name matters beyond the
gate too: rollback-migrations.ts keys manifest-based rollback on it, so a
blank or mismatched one silently drops the migration from that path instead
of failing loudly — the gate also checks it matches the exported class name.
Set all four anyway; do not rely on the gate to catch it.
Step 5: REGISTER THE MIGRATION
Open packages/server/api/src/app/database/postgres-connection.ts and add the new migration class to the getMigrations() array (at the end, in chronological order):
import { AddMyColumn1234567890 } from './migration/postgres/1234567890-AddMyColumn'
// Inside getMigrations():
return [
// ... existing migrations ...
AddMyColumn1234567890,
]Step 6: UPDATE TYPES AND SERVICE CODE
After the migration is generated and registered, update any TypeScript types, service files, or other code that references the changed columns to stay in sync with the new schema.
Note:
Always try to create non-breaking migrations if possible to allow safe rollbacks
Zero errors required before the task is complete.
Using CONCURRENTLY
Qadam Flow runs against real PostgreSQL only (PGLite support was removed). When creating or dropping indexes with CONCURRENTLY, set transaction = false on the migration — PostgreSQL requires it, since CONCURRENTLY cannot run inside a transaction:
import { QueryRunner } from 'typeorm'
import { Migration } from '../../migration'
export class AddMyIndex1234567890 implements Migration {
name = 'AddMyIndex1234567890'
breaking = false
release = '0.78.0'
transaction = false // Required when using CONCURRENTLY
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE INDEX CONCURRENTLY "idx_name" ON "table" ("column")`)
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX CONCURRENTLY "idx_name"`)
}
}Quick Reference
| Field | Value |
| Migration files | packages/server/api/src/app/database/migration/postgres/ |
| Registration | packages/server/api/src/app/database/postgres-connection.ts |
Migration import | import { Migration } from '../../migration' |
| Generate command | npm run db-migration -- src/app/database/migration/postgres/MigrationName (run from packages/server/api/) |
Critical Reminders
- Always generate via CLI — never write migration SQL by hand; use
npm run db-migrationto generate from the entity diff - Never use
MigrationInterface— always patch the generated file to useMigrationfrom../../migration name,breaking,release, anddown()are mandatory — set them explicitly; a required CI check (npm run check-migration-metadata) rejects a new migration that omits one- Register in
postgres-connection.ts— migration won't run without this CONCURRENTLY— always settransaction = falsewhen using it
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

