before merge db