Hi
Is it feasible or horribly wrong to include a boolean column to a join table in order to 'junction' a join?
Imagine you want to map a journey that will comprise multiple flights and train journeys.
# train.rb # flight.rb # stages.rb # itinerary.rb
Itinerary has many flights [b]or[/b] trains journeys through stages.
I could put a column for each id, train and flight, or I can put a boolean flag that dictates whether the stage is a flight or train journey and define in the model the foreign key in both cases. In the case of the former, there will be a lot of null values so the latter seems preferable. Maybe an answer is a further join table, but for the purpose of this that is really not ideal.
So will this work ok or am I barking up the wrong tree? Thanks in advance.