docs: add migration conflict resolution and worked migrate.ts example - #1987
Conversation
…xample Document how to resolve a migration number add/add conflict (save script edits, take the other side's directory, delete non-conflicting leftovers, re-generate, port the script) and when a plain directory rename is safe. Add a complete worked example to Migration Script Anatomy (required enum field backfill) and link the repository's migration fixture templates for other breaking-change patterns.
Save script edits from ORIG_HEAD (the pre-rebase branch tip) instead of REBASE_HEAD, note that warning-tier changes need 'migration script' to recreate the scaffold before porting, and scope the rename safety check: schema validation cannot detect migrate.ts reads of types the other migration changes. Drop a comment that restated the adjacent update.
Note that fixture template scripts need adapting to real data (the 0006 suffix strategy can collide with existing names), and extend the rename safety check to cover script writes as well as reads of types the other migration touches.
|
@tailor-platform/create-sdk
@tailor-platform/eslint-plugin-sdk
@tailor-platform/sdk
@tailor-platform/sdk-plugin-seed
@tailor-platform/sdk-plugin-tailordb-erd
commit: |
Code Metrics Report (packages/sdk)
Details | | main (6396b4d) | #1987 (c2c0d33) | +/- |
|--------------------|----------------|-----------------|------|
| Coverage | 78.5% | 78.5% | 0.0% |
| Files | 463 | 463 | 0 |
| Lines | 17768 | 17768 | 0 |
| Covered | 13956 | 13956 | 0 |
| Code to Test Ratio | 1:0.4 | 1:0.4 | 0.0 |
| Code | 126901 | 126901 | 0 |
| Test | 62068 | 62068 | 0 |SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
There was a problem hiding this comment.
📖 Docs Quality & Consistency Check
✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.
Checked areas:
-
Worked example (backfilling a new required enum field):
- Verified
db.table(),db.string(),db.enum(),db.fields.timestamps()APIs match actual SDK patterns inexample/tailordb/user.ts - Verified
Transactiontype import from"./db"is correct - Verified Kysely API usage (
trx.updateTable().set().where().execute()) is accurate - Verified idempotency pattern (
where("role", "is", null)) matches template patterns - Verified links to migration fixture templates at
example/tests/migration-fixtures/templates/0005and0006exist and contain the described patterns
- Verified
-
Migration conflict resolution procedure:
- Verified
tailor tailordb migration generate,validate, andscriptCLI commands exist inpackages/sdk/src/cli/commands/tailordb/migrate/ - Verified
ORIG_HEADgit reference usage is standard and correct - Verified file structure references (
migrations/NNNN/diff.json,migrate.ts) match the documented migration system - Verified terminology ("warning-tier change", "breaking change") is consistent with existing documentation
- Verified
-
Reader perspective:
- Confirmed all documented content describes user-facing behavior (git operations, CLI commands, file structure)
- No internal implementation details leaked (no parser/bundler internals, no internal class names)
- GitHub links point to public repository (
tailor-platform/sdk) - All content appropriately addresses SDK users
Re-run this check by adding the
docs-checklabel to the PR.
Summary
Document the recovery procedure for migration number conflicts and add a worked
migrate.tsexample to the TailorDB migration guide.Added guidance
ORIG_HEAD, take the other side's directory in full, delete leftovers that never conflicted, re-generate, and port the script — plus when a plain directory rename is acceptable and howtailor tailordb migration validatearbitrates it.