Reputation: 6121
I've a couple of questions.
I'm making a rudimentary CMS with Rails to get a hang of it. It's going to have pages, blog posts that belong to certain categories (think wordpress) which admins can add/edit from admin area. I'm a bit shaky on databases and relationships between them, though.
I want admins to have full access to the pages and blog posts; blog posts and pages must be separate entities - pages can go in the menu, while blog posts show up on the blog.
How do I organize this as far as the database relationships go so it's all nice and proper?
pages belongs to and has many categories posts belongs to and has many categories?
Also, in what scenarios is the use of add_index() necessary/advisable?
From a bird's eye view, what principles would you keep in mind when creating databases for a CMS?
Upvotes: 4
Views: 283
Reputation: 5311
think about it in terms of relations:
finally, add indexes on columns where you'll need faster/frequent lookups
Upvotes: 2