How to delete rows which are not recent in a 1-to-many table.
create table foo (id, ...)
create table bar (id, foo_id, created_at, ...)
I would like to delete all bars for each foo and keep only 10 bars (max) for each foo. How do I delete this in a dynamic fashion