Agent skill

db-migration

Creates TypeORM database migrations for the Activepieces server. Use when the user asks to add a column, create a table, add an index, or make any schema change to the database.

Stars 21,671
Forks 3,529

Install this agent skill to your Project

npx add-skill https://github.com/activepieces/activepieces/tree/main/.agents/skills/db-migration

SKILL.md

Activepieces DB Migration

Create TypeORM database migrations for schema changes in the Activepieces 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 current release version (check root package.jsonversion)

Step 2: UPDATE THE ENTITY

Update the TypeORM entity file in packages/server/api/src/app/ to reflect the new schema. This ensures the generation command can diff against the current state.

Array columns always use this pattern:

ts
columnName: {
    type: String,
    array: true,
    nullable: false,
}

Step 2: CREATE THE MIGRATION FILE

ts
import { QueryRunner } from 'typeorm'
import { Migration } from '../../migration' // ← must import from ../.. 

export class AddMyColumn1234567890 implements Migration {
    name = 'AddMyColumn1234567890'
    breaking = false 
    release = '0.78.0'   // ← match the upcoming release version from root package.json

    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:

  • breaking = false — set to true only if rolling back is destructive
  • release = '<version>' — the upcoming release version from root package.json
  • down() — must reverse up() (required)

CI fails if any of these are missing.

Step 3: 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):

ts
import { AddMyColumn1234567890 } from './migration/postgres/1234567890-AddMyColumn'

// Inside getMigrations():
return [
    // ... existing migrations ...
    AddMyColumn1234567890,
]

Note:

Always try to create non-breaking migrations if possible to allow safe rollbacks

Zero errors required before the task is complete.


PGlite Compatibility

PGlite does not support CONCURRENTLY (it is a single-connection embedded database). When creating or dropping indexes with CONCURRENTLY, add a PGlite check:

ts
import { QueryRunner } from 'typeorm'
import { Migration } from '../../migration'
import { system } from '../../../helper/system/system'
import { AppSystemProp } from '../../../helper/system/system-props'
import { DatabaseType } from '../../database-type'

const isPGlite = system.get(AppSystemProp.DB_TYPE) === DatabaseType.PGLITE

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> {
        if (isPGlite) {
            await queryRunner.query(`CREATE INDEX "idx_name" ON "table" ("column")`)
        } else {
            await queryRunner.query(`CREATE INDEX CONCURRENTLY "idx_name" ON "table" ("column")`)
        }
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        if (isPGlite) {
            await queryRunner.query(`DROP INDEX "idx_name"`)
        } else {
            await queryRunner.query(`DROP INDEX CONCURRENTLY "idx_name"`)
        }
    }
}

Set transaction = false whenever using CONCURRENTLY — PostgreSQL requires it.


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'

Critical Reminders

  1. Never use MigrationInterface — always use Migration from ../../migration
  2. breaking, release, and down() are mandatory — CI will reject the migration without them
  3. Register in postgres-connection.ts — migration won't run without this
  4. PGlite + CONCURRENTLY — always guard with isPGlite and set transaction = false

Expand your agent's capabilities with these related and highly-rated skills.

activepieces/activepieces

piece-builder

Builds Activepieces pieces (integrations) with actions and triggers. Use when the user asks to create a new piece, add actions to a piece, add triggers to a piece, or build an integration for a third-party app. Also use when the user mentions Activepieces pieces, connectors, or integration development.

21,671 3,529
Explore
activepieces/activepieces

playwright-e2e-testing

Playwright modern end-to-end testing framework with cross-browser automation, auto-wait, and built-in test runner

21,671 3,529
Explore
activepieces/activepieces

mintlify

Build and maintain documentation sites with Mintlify. Use when creating docs pages, configuring navigation, adding components, or setting up API references.

21,671 3,529
Explore
activepieces/activepieces

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

21,671 3,529
Explore
sickn33/antigravity-awesome-skills

obsidian-clipper-template-creator

Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.

28,421 4,766
Explore
sickn33/antigravity-awesome-skills

claude-code-expert

Especialista profundo em Claude Code - CLI da Anthropic. Maximiza produtividade com atalhos, hooks, MCPs, configuracoes avancadas, workflows, CLAUDE.md, memoria, sub-agentes, permissoes e integracao com ecossistemas.

28,421 4,766
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results