vaultik/internal/snapshot
sneak 43a69c2cfb Fix FK constraint errors in batched file insertion
Generate file UUIDs upfront in checkFileInMemory() rather than
deferring to Files.Create(). This ensures file_chunks and chunk_files
records have valid FileID values when constructed during file
processing, before the batch insert transaction.

Root cause: For new files, file.ID was empty when building the
fileChunks and chunkFiles slices. The ID was only generated later
in Files.Create(), but by then the slices already had empty FileID
values, causing FK constraint failures.

Also adds PROCESS.md documenting the snapshot creation lifecycle,
database transactions, and FK dependency ordering.
2025-12-19 19:48:48 +07:00
..
backup_test.go Major refactoring: Updated manifest format and renamed backup to snapshot 2025-07-26 03:27:47 +02:00
file_change_test.go Optimize scan phase: in-memory change detection and batched DB writes 2025-12-19 12:08:47 +07:00
manifest.go Major refactoring: Updated manifest format and renamed backup to snapshot 2025-07-26 03:27:47 +02:00
module.go Add pluggable storage backend, PID locking, and improved scan progress 2025-12-19 11:52:51 +07:00
progress.go Refactor: Move Vaultik struct and methods to internal/vaultik package 2025-07-26 14:47:26 +02:00
scanner_test.go Optimize scan phase: in-memory change detection and batched DB writes 2025-12-19 12:08:47 +07:00
scanner.go Fix FK constraint errors in batched file insertion 2025-12-19 19:48:48 +07:00
snapshot_test.go Integrate afero filesystem abstraction library 2025-07-26 15:33:18 +02:00
snapshot.go Fix foreign key error when deleting incomplete snapshots 2025-12-19 12:27:05 +07:00