Migration script now resets SERIAL sequences (audit_log, context_files, etc.) to max(existing_id) after copying rows. Without this, the sequence is still at its post-schema-creation value and every INSERT hits a duplicate key error.