Command Palette

Search for a command to run...

Назад к скиллам
скилл № 00940

liquibase-migrations

Use for any question or task about Liquibase, including quick ones such as rolling back a changeset or adding a rollback block: changelogs and changesets in…

БесплатноБез исполняемых скриптов
testlandот testland★ 18 звёзд на GitHub

Установить liquibase-migrations в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

liquibase-migrations

Overview

Liquibase's distinguishing feature vs Flyway: changesets are format-portable (XML / YAML / JSON / SQL) and rollback-aware - each changeset declares its own rollback action, enabling deterministic per-changeset rollback rather than versioned-only migration replay.

State tracked in two tables (per Liquibase docs):

  • DATABASECHANGELOG - applied changeset history (id + author + filename + dateExecuted + checksum)
  • DATABASECHANGELOGLOCK - distributed lock to serialize concurrent update runs

When to use

  • The repo has db.changelog-master.xml / .yaml / .json.
  • The user works with Spring Boot Liquibase auto-config or any of the Liquibase Maven / Gradle / Ant plugins.
  • The team needs cross-DBMS portable migrations (XML/YAML changesets translate to per-DBMS SQL at apply time).
  • Per-changeset rollback support is required (vs Flyway's whole-version rollback).

Step 1 - Install

Pick one runner and pin its version:

# CLI in a container (CI and local)
docker run --rm -v "$PWD/changelog:/liquibase/changelog" \
  -e LIQUIBASE_COMMAND_PASSWORD \
  liquibase/liquibase:5.0.4 \
  --url=jdbc:postgresql://host/db --username=app \
  --changelog-file=changelog/db.changelog-master.yaml \
  status --verbose

Keep the password off the command line: any command option can be set as LIQUIBASE_COMMAND_<option-name> ([environment variables][lb-env]), and -e LIQUIBASE_COMMAND_PASSWORD with no value forwards the host's variable into the container ([docker run][docker-env]).

Maven ([Maven integration][lb-mvn]):

<plugin>
  <groupId>org.liquibase</groupId>
  <artifactId>liquibase-maven-plugin</artifactId>
  <version>5.0.4</version>
  <configuration>
    <changeLogFile>src/main/resources/db/changelog/db.changelog-master.yaml</changeLogFile>
    <url>${env.DB_URL}</url>
    <username>${env.DB_USER}</username>
    <password>${env.DB_PASSWORD}</password>
  </configuration>
</plugin>

then mvn liquibase:validate liquibase:update. Spring Boot: with spring-boot-starter-liquibase on the classpath, migrations run at startup and before tests, reading db/changelog/db.changelog-master.yaml unless spring.liquibase.change-log says otherwise ([Spring Boot][sb-lb]).

Step 2 - Changelog + changeset basics

A changelog is a file (or set of included files) containing one or more changeset entries. Each changeset has an id + author (these are the identity for the DATABASECHANGELOG row).

YAML example:

databaseChangeLog:
  - changeSet:
      id: 1
      author: alice
      changes:
        - createTable:
            tableName: users
            columns:
              - column:
                  name: id
                  type: bigint
                  autoIncrement: true
                  constraints: { primaryKey: true, nullable: false }
              - column:
                  name: email
                  type: varchar(255)
                  constraints: { unique: true, nullable: false }
      rollback:
        - dropTable:
            tableName: users
  - changeSet:
      id: 2
      author: alice
      changes:
        - addColumn:
            tableName: users
            columns:
              - column: { name: created_at, type: timestamp }
      rollback:
        - dropColumn: { tableName: users, columnName: created_at }

Equivalent forms in XML / JSON / SQL exist - pick by team preference; they're functionally equivalent at apply time. (Per [lb-docs][lb-docs] for format-specific syntax.)

Step 3 - Gate: validate and preview before update

Run these in order; stop at the first failure:

liquibase validate                       # 1. syntax, duplicate id/author/file, checksums
liquibase status --verbose               # 2. which changesets are pending
liquibase update-sql > pending.sql       # 3. read the SQL that update would run
liquibase update                         # 4. apply

validate checks that the changelog parses, that no id / author / file combination repeats, and that no applied changeset's checksum changed ([validate][lb-validate]). update-sql prints the SQL update would run so it can be reviewed; it does not check that SQL for correctness ([update-sql][lb-updatesql]).

On a checksum error, someone edited a changeset that already ran. Revert the edit and put the change in a new changeset. Only if the edit is deliberately harmless (a comment, whitespace), add that changeset's new checksum to a validCheckSum entry and say why in the PR; never clear checksums to make the gate pass.

On a held lock after an interrupted run, confirm no other Liquibase process is running, then liquibase release-locks ([release-locks][lb-locks]).

Other commands:

Command Use
liquibase history Show executed changesets
liquibase tag <tag> / rollback <tag> Mark a state; roll back to it
`liquibase rollbac
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • .tessl-plugin/plugin.json

FAQ

Что делает скилл liquibase-migrations?

Use for any question or task about Liquibase, including quick ones such as rolling back a changeset or adding a rollback block: changelogs and changesets in XML, YAML, JSON or SQL, update, status, rollback and tag, preconditions, contexts and labels, and the changelog lock tables, for portable migrations across databases.

Как установить скилл liquibase-migrations?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл liquibase-migrations запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить liquibase-migrations с