Skill · em Construir backend e dados

PocketBase Migrations

Schema migrations and versioning for PocketBase. Use when creating migrations, managing schema versions, syncing collections between environments, using automigrate, or creating collections programmatically. Covers migrate commands, migration file format, snapshot imports, and the _migrations…

Procedência

Antes de instalar

1 arquivo · 8,9 KB · só texto, nenhum script

Instalar na sua CLI

O comando baixa a versão fixada (commit 57f899e) direto da origem, para a pasta que a CLI lê. Precisa de curl (macOS e Linux); no Windows não há comando, porque o Rook Labs é para macOS.

Claude Code

Neste projeto: O name desta skill (“PocketBase Migrations”) não segue o padrão das CLIs (minúsculas e hífens, igual ao nome da pasta): instalada assim, a CLI pode ignorá-la.

Global: O name desta skill (“PocketBase Migrations”) não segue o padrão das CLIs (minúsculas e hífens, igual ao nome da pasta): instalada assim, a CLI pode ignorá-la.

Codex

Neste projeto: O name desta skill (“PocketBase Migrations”) não segue o padrão das CLIs (minúsculas e hífens, igual ao nome da pasta): instalada assim, a CLI pode ignorá-la.

Global: O name desta skill (“PocketBase Migrations”) não segue o padrão das CLIs (minúsculas e hífens, igual ao nome da pasta): instalada assim, a CLI pode ignorá-la.

Antigravity

Neste projeto: O name desta skill (“PocketBase Migrations”) não segue o padrão das CLIs (minúsculas e hífens, igual ao nome da pasta): instalada assim, a CLI pode ignorá-la.

Global: O name desta skill (“PocketBase Migrations”) não segue o padrão das CLIs (minúsculas e hífens, igual ao nome da pasta): instalada assim, a CLI pode ignorá-la.

Peça ao Rook

Já usa o Rook Labs? Cole no chat do Rook: instale a skill https://rooklabs.sh/marketplace/cct.pocketbase-migrations

Prévia do SKILL.md

---
name: "PocketBase Migrations"
description: "Schema migrations and versioning for PocketBase. Use when creating migrations, managing schema versions, syncing collections between environments, using automigrate, or creating collections programmatically. Covers migrate commands, migration file format, snapshot imports, and the _migrations tracking tab…
---

# PocketBase Migrations & Schema Versioning

## Overview

PocketBase supports two approaches to schema management:

1. **Auto-migrate** (default in dev) — Dashboard changes auto-generate migration files in `pb_migrations/`
2. **Manual migrations** — write migration files by hand for full control

## CLI Commands

```bash
# Create a new empty migration file
./pocketbase migrate create "add_posts_collection"
# Creates: pb_migrations/1234567890_add_posts_collection.js

# Apply all pending migrations
./pocketbase migrate up

# Revert the last applied migration
./pocketbase migrate down

# Generate a full snapshot of all current collections
./pocketbase migrate collections
# Creates a migration file that recreates all collections from scratch

# Sync migration history with actual DB state (mark all as applied)
./pocketbase migrate history-sync
```

## Auto-migrate Mode

Enabled by default. When you change collections in the Dashboard, PocketBase auto-generates migration files in `pb_migrations/`.

```bash
…

Ver todo o marketplace