Remove sequential ID generation and SyncAllCounters (bd-c7af, bd-8e05, bd-4c74)
- Removed SyncAllCounters() and all call sites (already no-op with hash IDs) - Removed AllocateNextID() and getNextIDForPrefix() - sequential ID generation - Removed collision remapping logic in internal/storage/sqlite/collision.go - Removed rename collision handling in internal/importer/importer.go - Removed branch-merge example (collision resolution no longer needed) - Updated EXTENDING.md to remove counter sync examples These were all deprecated code paths for sequential IDs that are obsolete with hash-based IDs. Hash ID collisions are handled by extending the hash, not by remapping to new sequential IDs.
This commit is contained in:
@@ -290,17 +290,7 @@ func renumberIssuesInDB(ctx context.Context, prefix string, idMapping map[string
|
||||
}
|
||||
|
||||
// Update the counter to the highest renumbered ID so next issue gets correct number
|
||||
// After renumbering to bd-1..bd-N, set counter to N so next issue is bd-(N+1)
|
||||
// We need to FORCE set it (not MAX) because counter may be higher from deleted issues
|
||||
// Strategy: Reset (delete) the counter row, then SyncAllCounters recreates it from actual max ID
|
||||
sqliteStore, _ := store.(*sqlite.SQLiteStorage)
|
||||
if err := sqliteStore.ResetCounter(ctx, prefix); err != nil {
|
||||
return fmt.Errorf("failed to reset counter: %w", err)
|
||||
}
|
||||
// Now sync will recreate it from the actual max ID in the database
|
||||
if err := sqliteStore.SyncAllCounters(ctx); err != nil {
|
||||
return fmt.Errorf("failed to sync counter: %w", err)
|
||||
}
|
||||
// REMOVED (bd-c7af): Counter sync after renumbering - no longer needed with hash IDs
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user