split record and media into two tables