It also automatically "irrigates" whatever terrain happens to be under your city.
If that terrain however does not get any irrigation bonuses in the @TERRAIN section in rules.txt, it won't give extra food.
For example building on forest still yields just one food, since irrigate bonus is listed as 0 in said file. Normally, irrigating a forest tile changes it to plains which is why there is no bonus.
Desert cities have 1 food versus 0 for worked tiles.
Meanwhile if you build on hills, it give you one extra food since the bonus flag in @TERRAIN for hills is 1.
Farmland similarly adds another point but only if there is already at least one food from the base tile. Farmland on desert doesn't improve it beyond irrigation, neither as a worked tile, nor as city tile.
Oh, and you can't build a mine on city tiles, even if the underlying terrain normally supports it. In theory, you could start building a mine, then build a city with another settler/engineer and the mine will eventually be constructed.
However, discovering railroad will not improve the shield production as you'd expect from a normal mined&railroaded hill but its functionality in terms of movement would behave normally.
Farmland automatically appears there once the proper tech is discovered and like everywhere else, only works with supermarkets.