I'm creating a classifieds site where there are many categories and subcategories. 1) Each category has different fields. 2) Each listing has one or more images
I need help with the database design. My current thinking is:
- Listings table. fields: id, image_id etc.
- A table for each category, which would contain a listing_id
- Images table. fields: listing_id
- I'm not sure how I'd go about doing subcategories. I'm a bit of a noob, so I may be on the wrong track altogether.
I'm using postgresql by the way.