Q:

database structure for unconstant items

I have a database which own events as following :
event(id, name, type, startDate, endDate)

The type is another custom object (Type(id, name, icon)) which is linked as one-to-many.
I want to add another custom object named EventDetail containing details, but the fields would be different with the type of the event.
For instance, if my event is a travel type, fields could be a weblink to the wikipedia of destination, a photo, but if event is an internship for work they would evidently be different.
What kind of structure could handle this type of situation ?
If it is important, I'm using java for android, with an ORM library named SugarORM
Final answer
I finally headed to ORM libraries for managing my database. Using a one-to-one relation between Type and EventDetail and one-to-many between Type and Event, it works really well for now.

A:

You can go a few different ways with this...
One would be to create a catch-all table for EventDetail that has every field would need for every type and use the type to determine which fields you read from in that table.
Another way, if you do not have a lot of different types, would be to create a table for each type that would be structured to the needs of that type, in your queries, you would need to join to each of the tables based on the type (probably with using UNION [ALL], one query per type - or create views).
A third, and probably more ideal depending on the situation and use, would be to remove that level of complexity from the database. Store your "Event Details" as a CLOB or BLOB or XMLTYPE, etc... and use the type to deserialize the data to an object on the client side.

