I encountered an interesting SQL table (column names listed):
From_TableName | From_Id | To_TableName | To_Id
From what I understood, this table is used for all table relationships in the database. There's not a lot of data (more than 10000 lines in the previously mentioned table) in the database, so, I guess, performance was not that important. I'm not a SQL expert, so I decided to ask here: should I send this to DailyWTF or is this a viable solution in some situations?
My thoughts: I just don't see any upsides with this approach. Sure, you only need one table for all your relationships, but that's hardly a plus. And I'm not sure if there's really less work, when you create a new table. Unless you want to let your users do anything at all, there must be some kind of validation logic (what kind of relationships are valid) somewhere and you need to update that.