Skip to main content

bump-migration

Bump a database migration's timestamp to the current time. Required when a PR's migration is older than one already merged to main. Use when asked to "bump migration", "update migration timestamp", or when a migration ordering conflict is detected.

설치로 이동

소스 정보

저장소
fleetdm/fleet
최근 소스 활동
2026년 4월 6일 23:48
감지된 SKILL.md 언어
영어
스타
6,894
포크
1,024

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
bump-migration
description
Bump a database migration's timestamp to the current time. Required when a PR's migration is older than one already merged to main. Use when asked to "bump migration", "update migration timestamp", or when a migration ordering conflict is detected.
allowed-tools
Bash(go run *), Bash(make dump-test-schema*), Bash(git diff*), Bash(ls *), Read, Grep, Glob
model
sonnet
effort
medium
# Bump a database migration timestamp Bump the migration: $ARGUMENTS ## When to use This is required when a PR has a database migration with a timestamp older than a migration already merged to main. This happens when a PR has been pending merge for a while and another PR got merged with a more recent migration. ## Process ### 1. Identify the migration to bump If the user provided a filename, use that. Otherwise, find migrations on this branch that are older than the latest on main: ```bash # List migrations on this branch that aren't on main git diff origin/main --name-only -- server/datastore/mysql/migrations/tables/ ``` ### 2. Run the bump tool The tool lives at `tools/bump-migration/main.go`. Run it from the repo root: ```bash go run tools/bump-migration/main.go --source-migration YYYYMMDDHHMMSS_MigrationName.go ``` This will: - Rename the migration file with a new current timestamp - Rename the test file (if it exists) - Update all function names inside both files (`Up_OLDTS` → `Up_NEWTS`, `Down_OLDTS` → `Down_NEWTS`, `TestUp_OLDTS` → `TestUp_NEWTS`) ### 3. Optionally regenerate the schema If the migration affects the schema, add `--regen-schema` to also run `make dump-test-schema`: ```bash go run tools/bump-migration/main.go --source-migration YYYYMMDDHHMMSS_MigrationName.go --regen-schema ``` ### 4. Verify - Check that the old files are gone and new files exist with the updated timestamp - Verify the function names inside the files match the new timestamp - Run `go build ./server/datastore/mysql/migrations/...` to check compilation ## Rules - Always run from the repo root - Provide the migration filename, not the test filename - The tool handles both the migration and its test file automatically
GitHub에서 보기