Desalinate the cod from the previous day, unless the cod you are using is already desalinated. Remember, it's not enough to put the cod in plenty of cold water to desalinate. You should change water at least 6-7 times and the cod must stay in the water for at least 10 hours.
Then let it in a drainer to drain well.
Cut the 2 onions in slices and finely chop the one of them along with the garlic clove.
In a large and deep pan, saute the onions and garlic with olive oil until they become soft, stirring frequently. When the temperature is lowered, add the sugar, tomato juice, bay leaves, thyme, salt and pepper. Add the tomato paste dissolved in 1 cup of hot water and finally the raisins.
Let simmer for 5 minutes and preheat the oven.
Cut the tomatoes into thick slices.
In a large pan, lay half the slices of tomato and on top the pieces of cod. Pour the sauce and dangle the baking pan so it can go everywhere. Lay the remaining tomatoes, pour over some olive oil and add 1-2 bay leaves.
Bake at 180 ° C for about 1 hour (on the resistors). The food is ready as soon as the sauce thickens.