fix: complete UUID primary keys cleanup#2597
Conversation
Follow-up to 1ce765e (UUID primary keys for federation-safe events). The core migration changed types and schema, but many files still referenced the old AUTO_INCREMENT design. This commit makes the codebase internally consistent: - Update embedded Dolt schema SQL files to use CHAR(36) UUID PKs - Fix backup restore: json.Number -> string for UUID event/comment IDs (fixes TestBackupRestoreRoundTrip) - Remove dead LastEventID field from backup state (never set) - Update comments in issueops/create.go, import test, git_remote_test - Update docs/audit-sync-mode-complexity.md (mark auto-increment resolved) - Update version history in info.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@coderabbitai review |
CodeRabbit CLI Review |
|
Thanks for digging through the UUID cleanup here. While auditing the backup/restore behavior I confirmed the I opened a narrower issue/PR pair for that specific regression in case it helps review or cherry-picking:
Not trying to step on the broader cleanup work here, just wanted the backup restore bug to have its own tight repro and passing regression proof. |
@garitar All good, best part about open source is we're all building toward the same goal. I'm not personally attached to my code being used as long as it drives the project forward :) |
Resolves cherry-pick conflicts (backup_git_transport, backup_restore, circuit_test) by taking upstream versions — our cherry-picks (gastownhall#2604, gastownhall#2596, gastownhall#2599, 3034015) are now included in upstream. Key changes in v0.61.0: - Schema v8: no_history column (migration 011) - UUID primary keys cleanup (gastownhall#2597) - CLI credential routing for Dolt server (gastownhall#2543) - --no-history flag (gastownhall#2622) - --claim-next on close (gastownhall#2594) - Doctor bare-parent fallback fixes - Prime SSOT tasks 1-12
Summary
Follow-up to #2575 (UUID primary keys cherry-pick). The core migration changed types and schema, but many files throughout the codebase still referenced the old AUTO_INCREMENT design. This PR makes the codebase internally consistent.
Changes
json.Number->stringfor event/comment IDs inbackup_restore.go— UUID strings can't unmarshal asjson.Number, causingTestBackupRestoreRoundTripto failBIGINT AUTO_INCREMENT PRIMARY KEY->CHAR(36) NOT NULL PRIMARY KEY DEFAULT (UUID())for comments, events, issue_snapshots, compaction_snapshots, wisp_events, wisp_commentsLastEventID int64from backup state struct — was never set during export, vestige of integer ID eraissueops/create.go— PersistComments docsgit_remote_test.go— test name and comments (renamedTestAutoIncrementAfterPull->TestCreateIssueAfterPull)import_from_jsonl_test.go— comment dedup test descriptiondocs/audit-sync-mode-complexity.md— mark auto-increment reset section as resolvedcmd/bd/info.go— version history entryWhat was NOT changed (intentionally)
005_wisp_auxiliary_tables.go): Still uses BIGINT schema because existing databases ran this migration already; migration 010 converts themmigrations_test.go: Test tables use BIGINT to represent pre-migration-010 stateconcurrency_test.goandbd-example-extension-go: Use AUTO_INCREMENT on their own custom tables, not the 6 beads tablesTesting
go build ./...— passesgo vet ./...— passesTestBackupRestoreRoundTrip— now passes (was broken by UUID commit)Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com