Skip to main content
0 online
iwz Jun 6, 2006

Here's a design problem I'm running into. I have a bunch of different objects that all need to accept comments. Topics (News, Journals, ForumThreads) Single Table Inheritance Pictures Event...

dgiaimo Jun 6, 2006

Why do you need to reference both thread_type and generic_id? Couldn't you make sure that generic_id is unique across the various tables? If not, then you could add another table (maybe called "C...

iwz iwz

Yeah.. that's why; the legacy schema has a separate table and sequence for every type of topic. Kind of unwieldy.

I've been thinking about it a bit. I may go down the road of merging all the commentable types into a single table. It'll just be a bulky table. Events, which has LOTS of unique fields, I may make a child table for that holds all the unique stuff. Not sure if that's the best way to do it tho.

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.