BEGIN;
UPDATE invoices SET status = 'archived' WHERE created_at < '2025-01-01';
SAVEPOINT before_cleanup;
DELETE FROM invoices WHERE checksum IS NULL;
ROLLBACK TO before_cleanup;
COMMIT;
