FTS-1710 Make overwrite_flag a ternary flag in the DB

1 job for develop in 2 minutes and 33 seconds (queued for 14 seconds)