eng-schema-migration
Change Compozy SQLite tables, columns, indexes, constraints, triggers, or seed data under internal/store using append-only Goose migrations and owning generators. Excludes in-memory structures and non-SQLite caches.
- License 许可
- MIT
- 所属仓库
- compozy/compozy
- 最近更新
- 2026-11-15
- Stars
- ★ 2.9k
- Forks
- 187
01 前言 Front Matter
- name
- eng-schema-migration
- trigger
- implicit
- description
- Change Compozy SQLite tables, columns, indexes, constraints, triggers, or seed data under internal/store using append-only Goose migrations and owning generators. Excludes in-memory structures and non-SQLite caches.
02 资源文件 3
- 参考文档references/migration-decision.md2.3 KB
- 参考文档references/migration-template.md1.7 KB
- 参考文档references/migration-test-patterns.md1.4 KB
03 SKILL.md 正文
Compozy Schema Migration
Procedure
- Read
references/migration-decision.mdand classify the changed datum and owning stream:globalownscompozy.db;sessionowns eachevents.db;workspaceowns workspace observability databases. - Inspect the owner's declarative schema source (
schema/schema.sqlorschema/definitions/*.sql),schema/migrations/,schema/migrations/atlas.sum,migration_stream.go, sqlc query catalog, and canonical migration/open tests. Select the next gap-free five-digit version. Never edit, rename, renumber, reorder, or delete an existing migration or its checksum entry. - Read
references/migration-template.md. Edit the owning declarative source, then runmake codegen. Inspect the newly appended Goose SQL, Atlas sqlcheck result, refreshedatlas.sum, and regenerated sqlc output. If the generated tail is wrong, correct the declarative schema and regenerate; add bounded data transformation SQL only to the unpublished tail, then rerunmake codegen. - Update affected static queries in the owning sqlc catalog. Keep generated
sqlcgentypes inside the owner package and map them to domain types at the repository boundary. - Read
references/migration-test-patterns.md. Run the canonical suites that own fresh apply, reopen/data preservation, ahead-version refusal, integrity, sequential history, and schema equivalence. Extend cases only for a new transformation or failure mode not already covered. - If recovery or refusal guidance changes, move the whole stopped SQLite family (
.db,-wal,-shm, and sibling databases) to cold storage; never move or edit one live file. Prefer a newer compatible binary forschema_aheadwhen state must be preserved. - Run the owning scoped race-enabled migration checks and
make codegen-check. Reuse their current evidence and the affected lint lane; repository-wide gates run only in CI, per rootCLAUDE.md.
Error Handling
- Stop on any
atlas.summismatch or edited historical byte. Restore the exact unpublished history or append a new migration; never weaken validation or edit a Goose version table. - Resolve destructive Atlas diagnostics in the design. Do not suppress sqlcheck to force generation.
- User data survives every migration (SD-013): transform rows in the appended SQL instead of dropping them; a migration that drops or truncates user rows needs the user's sign-off recorded in an ADR plus a release-note
Migration notesblock. Document delete targets in the spec/ADR. Do not ship dual schemas or open-ended repair branches. - Treat a pre-Goose marker as
legacy_databaseand a recorded version above the embedded head asschema_ahead; neither condition authorizes in-place mutation.
04 同仓库更多 Skills
security-review
Security code review for vulnerabilities. Use when asked to "security review", "find vulnerabilities", "check for security issues", "audit security", "OWASP review", or review code for injection, XSS, authentication, authorization, cryptography issues. Provides systematic review with confidence-based reporting.
lesson-learned
Extract evidence-backed engineering lessons from recent changes or incidents. Use for requested reflection, lesson updates, or retiring an obsolete workflow rule.
compozy
Operate CompozyOS. Use when working with CompozyOS sessions, agents, native tools, skills, tasks, Loops, Goals, Terminal, desktops and windows, automation, extensions, or configuration. Don't use for unrelated projects.
remotion-upgrade
Upgrade Remotion, and related packages
remotion-studio
Preview a Remotion video
remotion-saas
Build an app with Remotion