You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. hash.rs: Sort tables by (order, table_name) for deterministic hashing
when multiple tables share the same order value.
2. db.rs (MySQL): Use SHA-256 generated column (row_key_hash) for the
row tracking table primary key instead of row_key(255) prefix index,
preventing key collisions for JSON keys exceeding 255 bytes.
3. docs/seeding.md: Clarify that reconcile mode only reconciles when the
rendered spec changes (hash mismatch), and that out-of-band DB changes
are not corrected until a spec change triggers reconciliation.
4. executor.rs: Add runtime guard for --reconcile-all — rejects seed sets
where any table lacks unique_key, preventing wrong-row updates/deletes
from identical row keys.
5. executor.rs: Skip hash-based fast path for seed sets containing @ref:
expressions, since resolved reference targets can change without
affecting the hash (e.g., upstream auto_id row reinserted).
6. executor.rs: Dry-run mode now treats @ref: as literals via
resolve_value_dry_run(), preventing failures when refs haven't been
populated (auto_id + refs within same seed set).
7. schema.rs: Reconcile validation now rejects empty/whitespace unique_key
entries, reserved column names (_ref) in unique_key, and rows missing
required unique_key columns.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
- Content hash (`content_hash` column) on the seed tracking table for fast "anything changed?" checks before row-by-row comparison.
16
16
- Automatic migration of existing tracking tables: the `content_hash` column is added transparently on first run. Existing seed sets remain in `once` mode with no behavior change.
17
17
18
+
### Changed
19
+
- Reconcile hash-skip now only applies to seed sets without `@ref:` expressions. Seed sets containing `@ref:` references always run row-level reconciliation to prevent stale foreign keys when upstream auto-generated IDs shift.
20
+
- Hash computation sorts tables by `(order, table_name)` instead of just `order` for deterministic hashing when multiple tables share the same order value.
21
+
- Dry-run mode treats `@ref:` expressions as literals to avoid failures when references haven't been populated yet (e.g., auto_id + refs within the same seed set).
22
+
23
+
### Fixed
24
+
-`--reconcile-all` now rejects seed sets where any table is missing `unique_key`, preventing reconciliation from generating identical row keys and updating/deleting wrong rows.
25
+
- Reconcile mode validation now rejects empty/whitespace-only `unique_key` entries and reserved column names like `_ref`.
26
+
- Reconcile mode validation now checks that every row contains all `unique_key` columns, preventing incomplete row keys during reconciliation.
27
+
- MySQL row tracking table now uses SHA-256 generated column (`row_key_hash`) for the primary key instead of `row_key(255)` prefix, preventing key collisions for JSON keys exceeding 255 bytes.
Copy file name to clipboardExpand all lines: docs/seeding.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,7 +217,9 @@ rows:
217
217
218
218
### Reconcile Mode
219
219
220
-
By default, seed sets are applied once and never modified (`mode: once`). Reconcile mode makes seeding declarative: the spec becomes the source of truth, and initium converges the database to match it on every run.
220
+
By default, seed sets are applied once and never modified (`mode: once`). Reconcile mode makes seeding declarative: the rendered spec becomes the source of truth, and initium reconciles the database to match it whenever the rendered spec changes.
221
+
222
+
If the rendered spec has not changed since the last run (content hash match), initium treats the seed set as already reconciled and skips it. Out-of-band database changes are not corrected until a spec change triggers reconciliation again.
0 commit comments