Fix db transaction on FogBugz importer
On FogBugz importer, all notes related to an issue are created in a single transaction, which may be a problem if there are too many notes since the transaction will be open for a long time.
Proposed solution
I believe the DB transaction is unnecessary, and we can remove it.
Also, we don't need to update the created_at
and updated_at
after creating the number if we include the attribute importing: true
For example we can create the note like:
Note.create!(
project_id: project.id,
noteable_type: "Issue",
noteable_id: issue.id,
author_id: author_id,
note: body,
created_at: date,
updated_at: date,
importing: true
)