>>/40305/
Clay also can be helpful, it doesn't let water through easily.
The picrel you posted. I would make the ditch lower than the level of the floor.
Crazy idea: I wonder if the clay of the ditch could be burnt to ceramic (by lighting fire in it, preferebly logs at the whole length of it) make it water resistant.