eng-schema-migration

Featured

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.

API & Backend 2,894 stars 189 forks Updated today MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Compozy Schema Migration ## Procedure 1. Read `references/migration-decision.md` and classify the changed datum and owning stream: `global` owns `compozy.db`; `session` owns each `events.db`; `workspace` owns workspace observability databases. 2. Inspect the owner's declarative schema source (`schema/schema.sql` or `schema/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. 3. Read `references/migration-template.md`. Edit the owning declarative source, then run `make codegen`. Inspect the newly appended Goose SQL, Atlas sqlcheck result, refreshed `atlas.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 rerun `make codegen`. 4. Update affected static queries in the owning sqlc catalog. Keep generated `sqlcgen` types inside the owner package and map them to domain types at the repository boundary. 5. 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. 6. If recovery or refusal guidance...

Details

Author
compozy
Repository
compozy/compozy
Created
7 months ago
Last Updated
today
Language
Go
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category